Webtools module added. 53/19253/24
Cedric Delamarre [Wed, 12 Apr 2017 09:13:05 +0000 (11:13 +0200)]
    * http get put post delete patch scilab function
    * download file by using the scilab http_get function
    * specific http_upload scilab function
    * scilab type conversion to/from JSON
    * proxy information used (pref -> internet)
    * Documentation
    * Tests

Change-Id: I59dc255a14c6dbdc4614c4df642fa3da2535148f

65 files changed:
scilab/CHANGES.md
scilab/Makefile.in
scilab/Scilab.sln
scilab/configure
scilab/configure.ac
scilab/etc/modules.xml.in
scilab/etc/modules.xml.vc
scilab/modules/Makefile.am
scilab/modules/Makefile.in
scilab/modules/functions_manager/includes/dynamic_modules.hxx
scilab/modules/functions_manager/src/cpp/dynamic_modules.cpp
scilab/modules/functions_manager/src/cpp/funcmanager.cpp
scilab/modules/helptools/etc/MAIN_CHAPTERS
scilab/modules/webtools/Makefile.am [new file with mode: 0644]
scilab/modules/webtools/Makefile.in [new file with mode: 0644]
scilab/modules/webtools/demos/webtools.dem.gateway.sce [new file with mode: 0644]
scilab/modules/webtools/etc/webtools.quit [new file with mode: 0644]
scilab/modules/webtools/etc/webtools.start [new file with mode: 0644]
scilab/modules/webtools/help/en_US/addchapter.sce [new file with mode: 0644]
scilab/modules/webtools/help/en_US/fromJSON.xml [new file with mode: 0644]
scilab/modules/webtools/help/en_US/http_delete.xml [new file with mode: 0644]
scilab/modules/webtools/help/en_US/http_get.xml [new file with mode: 0644]
scilab/modules/webtools/help/en_US/http_patch.xml [new file with mode: 0644]
scilab/modules/webtools/help/en_US/http_post.xml [new file with mode: 0644]
scilab/modules/webtools/help/en_US/http_put.xml [new file with mode: 0644]
scilab/modules/webtools/help/en_US/http_upload.xml [new file with mode: 0644]
scilab/modules/webtools/help/en_US/toJSON.xml [new file with mode: 0644]
scilab/modules/webtools/help/fr_FR/addchapter.sce [new file with mode: 0644]
scilab/modules/webtools/help/ja_JP/addchapter.sce [new file with mode: 0644]
scilab/modules/webtools/help/pt_BR/addchapter.sce [new file with mode: 0644]
scilab/modules/webtools/help/ru_RU/addchapter.sce [new file with mode: 0644]
scilab/modules/webtools/includes/dynlib_webtools.h [new file with mode: 0644]
scilab/modules/webtools/includes/gw_webtools.h [new file with mode: 0644]
scilab/modules/webtools/includes/webtools.h [new file with mode: 0644]
scilab/modules/webtools/includes/webtools_gw.hxx [new file with mode: 0644]
scilab/modules/webtools/license.txt [new file with mode: 0644]
scilab/modules/webtools/macros/buildmacros.bat [new file with mode: 0644]
scilab/modules/webtools/macros/buildmacros.sce [new file with mode: 0644]
scilab/modules/webtools/macros/cleanmacros.bat [new file with mode: 0644]
scilab/modules/webtools/sci_gateway/cpp/checkCommonOpt.cpp [new file with mode: 0644]
scilab/modules/webtools/sci_gateway/cpp/sci_fromJSON.cpp [new file with mode: 0644]
scilab/modules/webtools/sci_gateway/cpp/sci_http_delete.cpp [new file with mode: 0644]
scilab/modules/webtools/sci_gateway/cpp/sci_http_get.cpp [new file with mode: 0644]
scilab/modules/webtools/sci_gateway/cpp/sci_http_patch.cpp [new file with mode: 0644]
scilab/modules/webtools/sci_gateway/cpp/sci_http_post.cpp [new file with mode: 0644]
scilab/modules/webtools/sci_gateway/cpp/sci_http_put.cpp [new file with mode: 0644]
scilab/modules/webtools/sci_gateway/cpp/sci_http_put_post.cpp [new file with mode: 0644]
scilab/modules/webtools/sci_gateway/cpp/sci_http_upload.cpp [new file with mode: 0644]
scilab/modules/webtools/sci_gateway/cpp/sci_toJSON.cpp [new file with mode: 0644]
scilab/modules/webtools/sci_gateway/webtools_gateway.xml [new file with mode: 0644]
scilab/modules/webtools/src/c/DllmainWebtools.c [new file with mode: 0644]
scilab/modules/webtools/src/c/jsmn.c [new file with mode: 0644]
scilab/modules/webtools/src/c/jsmn.h [new file with mode: 0644]
scilab/modules/webtools/src/cpp/json.cpp [new file with mode: 0644]
scilab/modules/webtools/src/cpp/json.hxx [new file with mode: 0644]
scilab/modules/webtools/src/cpp/sciCurl.cpp [new file with mode: 0644]
scilab/modules/webtools/src/cpp/sciCurl.hxx [new file with mode: 0644]
scilab/modules/webtools/src/cpp/webtools.cpp [new file with mode: 0644]
scilab/modules/webtools/tests/unit_tests/jsonplaceholder.dia.ref [new file with mode: 0644]
scilab/modules/webtools/tests/unit_tests/jsonplaceholder.tst [new file with mode: 0644]
scilab/modules/webtools/webtools.filters [new file with mode: 0644]
scilab/modules/webtools/webtools.iss [new file with mode: 0644]
scilab/modules/webtools/webtools.rc [new file with mode: 0644]
scilab/modules/webtools/webtools.vcxproj [new file with mode: 0644]
scilab/modules/webtools/webtools.vcxproj.filters [new file with mode: 0644]

index ea91b9e..72ec64c 100644 (file)
@@ -27,7 +27,7 @@ consult the [embedded help](modules/helptools/data/pages/homepage-en_US.html). I
 as the "What's new" page of the help, by simply typing `help` in Scilab console.
 
 In summary, the main new features are:
-* 
+* Webtools utilities added for HTTP protocol, JSON data usage
 
 
 Installation
@@ -73,6 +73,8 @@ Feature changes and additions
 -----------------------------
  
 * Empty strings are used as the default values on String allocation
+* HTTP get, post, put, upload, patch, delete functions added
+* JSON encoding / decoding for Scilab datatypes added
 * Memory invalid accesses have been greatly reduced thanks to :
   - PVS-Studio inspections blog report
   - Coverity scan weekly source analysis
index 8cad7b7..f4c96ab 100644 (file)
@@ -481,11 +481,11 @@ am__DIST_COMMON = $(srcdir)/Makefile.in \
        $(top_srcdir)/modules/atoms/tests/unit_tests/repositories.orig.in \
        $(top_srcdir)/modules/core/includes/machine.h.in \
        $(top_srcdir)/modules/core/includes/version.h.in \
-       $(top_srcdir)/modules/helptools/etc/SciDocConf.xml.in \
-       ABOUT-NLS COPYING config/ar-lib config/compile \
-       config/config.guess config/config.rpath config/config.sub \
-       config/depcomp config/install-sh config/ltmain.sh \
-       config/missing config/mkinstalldirs
+       $(top_srcdir)/modules/helptools/etc/SciDocConf.xml.in COPYING \
+       config/ar-lib config/compile config/config.guess \
+       config/config.rpath config/config.sub config/depcomp \
+       config/install-sh config/ltmain.sh config/missing \
+       config/mkinstalldirs
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 distdir = $(PACKAGE)-$(VERSION)
 top_distdir = $(distdir)
index d9f6d2f..84caf4c 100644 (file)
@@ -518,6 +518,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "coverage", "modules\coverag
 EndProject
 Project("{6989167D-11E4-40FE-8C1A-2192A86A7E90}") = "scicos_blocks-cli_f", "modules\scicos_blocks\src\fortran\cli\scicos_blocks-cli_f.vfproj", "{3E0FF981-B5FB-4FC2-B6D8-8C1091FBB23A}"
 EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "webtools", "modules\webtools\webtools.vcxproj", "{8DBF9BA7-ABB8-4C35-A82A-0ADBEB7E5331}"
+EndProject
 Global
        GlobalSection(SolutionConfigurationPlatforms) = preSolution
                Debug|Win32 = Debug|Win32
@@ -1694,6 +1696,14 @@ Global
                {3E0FF981-B5FB-4FC2-B6D8-8C1091FBB23A}.Release|Win32.Build.0 = Release|Win32
                {3E0FF981-B5FB-4FC2-B6D8-8C1091FBB23A}.Release|x64.ActiveCfg = Release|x64
                {3E0FF981-B5FB-4FC2-B6D8-8C1091FBB23A}.Release|x64.Build.0 = Release|x64
+               {8DBF9BA7-ABB8-4C35-A82A-0ADBEB7E5331}.Debug|Win32.ActiveCfg = Debug|Win32
+               {8DBF9BA7-ABB8-4C35-A82A-0ADBEB7E5331}.Debug|Win32.Build.0 = Debug|Win32
+               {8DBF9BA7-ABB8-4C35-A82A-0ADBEB7E5331}.Debug|x64.ActiveCfg = Debug|x64
+               {8DBF9BA7-ABB8-4C35-A82A-0ADBEB7E5331}.Debug|x64.Build.0 = Debug|x64
+               {8DBF9BA7-ABB8-4C35-A82A-0ADBEB7E5331}.Release|Win32.ActiveCfg = Release|Win32
+               {8DBF9BA7-ABB8-4C35-A82A-0ADBEB7E5331}.Release|Win32.Build.0 = Release|Win32
+               {8DBF9BA7-ABB8-4C35-A82A-0ADBEB7E5331}.Release|x64.ActiveCfg = Release|x64
+               {8DBF9BA7-ABB8-4C35-A82A-0ADBEB7E5331}.Release|x64.Build.0 = Release|x64
        EndGlobalSection
        GlobalSection(SolutionProperties) = preSolution
                HideSolutionNode = FALSE
index 590f64d..561f8df 100755 (executable)
@@ -49261,7 +49261,7 @@ SCI_LDFLAGS=$(echo                                            \
 
 
 
-ac_config_files="$ac_config_files contrib/Makefile desktop/images/icons/Makefile desktop/Makefile modules/threads/Makefile modules/ast/Makefile modules/functions_manager/Makefile modules/helptools/Makefile modules/data_structures/Makefile modules/differential_equations/Makefile modules/optimization/Makefile modules/elementary_functions/Makefile modules/special_functions/Makefile modules/io/Makefile modules/completion/Makefile modules/history_manager/Makefile modules/jvm/Makefile modules/commons/Makefile modules/sound/Makefile modules/statistics/Makefile modules/mexlib/Makefile modules/sparse/Makefile modules/linear_algebra/Makefile modules/polynomials/Makefile modules/signal_processing/Makefile modules/arnoldi/Makefile modules/interpolation/Makefile modules/localization/Makefile modules/cacsd/Makefile modules/boolean/Makefile modules/integer/Makefile modules/fileio/Makefile modules/spreadsheet/Makefile modules/string/Makefile modules/time/Makefile modules/graphics/Makefile modules/graphic_export/Makefile modules/graphic_objects/Makefile modules/renderer/Makefile modules/action_binding/Makefile modules/gui/Makefile modules/mpi/Makefile modules/randlib/Makefile modules/tclsci/Makefile modules/windows_tools/Makefile modules/core/Makefile modules/prebuildjava/Makefile modules/api_scilab/Makefile modules/call_scilab/Makefile modules/types/Makefile modules/hdf5/Makefile modules/fftw/Makefile modules/umfpack/Makefile modules/scicos/Makefile modules/scicos_blocks/Makefile modules/functions/Makefile modules/dynamic_link/Makefile modules/overloading/Makefile modules/javasci/Makefile modules/m2sci/Makefile modules/compatibility_functions/Makefile modules/development_tools/Makefile modules/output_stream/Makefile modules/console/Makefile modules/demo_tools/Makefile modules/genetic_algorithms/Makefile modules/simulated_annealing/Makefile modules/parameters/Makefile modules/matio/Makefile modules/atoms/Makefile modules/xcos/Makefile modules/scinotes/Makefile modules/ui_data/Makefile modules/graph/Makefile modules/parallel/Makefile modules/modules_manager/Makefile modules/history_browser/Makefile modules/preferences/Makefile modules/xml/Makefile modules/external_objects/Makefile modules/external_objects_java/Makefile modules/slint/Makefile modules/coverage/Makefile modules/Makefile Makefile scilab.pc etc/modules.xml etc/classpath.xml etc/Info.plist etc/logging.properties scilab.properties scilab-lib.properties scilab-lib-doc.properties modules/helptools/etc/SciDocConf.xml modules/core/includes/version.h modules/atoms/etc/repositories modules/atoms/tests/unit_tests/repositories.orig"
+ac_config_files="$ac_config_files contrib/Makefile desktop/images/icons/Makefile desktop/Makefile modules/threads/Makefile modules/ast/Makefile modules/functions_manager/Makefile modules/helptools/Makefile modules/data_structures/Makefile modules/differential_equations/Makefile modules/optimization/Makefile modules/elementary_functions/Makefile modules/special_functions/Makefile modules/io/Makefile modules/completion/Makefile modules/history_manager/Makefile modules/jvm/Makefile modules/commons/Makefile modules/sound/Makefile modules/statistics/Makefile modules/mexlib/Makefile modules/sparse/Makefile modules/linear_algebra/Makefile modules/polynomials/Makefile modules/signal_processing/Makefile modules/arnoldi/Makefile modules/interpolation/Makefile modules/localization/Makefile modules/cacsd/Makefile modules/boolean/Makefile modules/integer/Makefile modules/fileio/Makefile modules/spreadsheet/Makefile modules/string/Makefile modules/time/Makefile modules/graphics/Makefile modules/graphic_export/Makefile modules/graphic_objects/Makefile modules/renderer/Makefile modules/action_binding/Makefile modules/gui/Makefile modules/mpi/Makefile modules/randlib/Makefile modules/tclsci/Makefile modules/windows_tools/Makefile modules/core/Makefile modules/prebuildjava/Makefile modules/api_scilab/Makefile modules/call_scilab/Makefile modules/types/Makefile modules/hdf5/Makefile modules/fftw/Makefile modules/umfpack/Makefile modules/scicos/Makefile modules/scicos_blocks/Makefile modules/functions/Makefile modules/dynamic_link/Makefile modules/overloading/Makefile modules/javasci/Makefile modules/m2sci/Makefile modules/compatibility_functions/Makefile modules/development_tools/Makefile modules/output_stream/Makefile modules/console/Makefile modules/demo_tools/Makefile modules/genetic_algorithms/Makefile modules/simulated_annealing/Makefile modules/parameters/Makefile modules/matio/Makefile modules/atoms/Makefile modules/xcos/Makefile modules/scinotes/Makefile modules/ui_data/Makefile modules/graph/Makefile modules/parallel/Makefile modules/modules_manager/Makefile modules/history_browser/Makefile modules/preferences/Makefile modules/xml/Makefile modules/external_objects/Makefile modules/external_objects_java/Makefile modules/slint/Makefile modules/coverage/Makefile modules/webtools/Makefile modules/Makefile Makefile scilab.pc etc/modules.xml etc/classpath.xml etc/Info.plist etc/logging.properties scilab.properties scilab-lib.properties scilab-lib-doc.properties modules/helptools/etc/SciDocConf.xml modules/core/includes/version.h modules/atoms/etc/repositories modules/atoms/tests/unit_tests/repositories.orig"
 
 
 # Detection of the module for the future version of Scilab 6
@@ -50700,6 +50700,7 @@ do
     "modules/external_objects_java/Makefile") CONFIG_FILES="$CONFIG_FILES modules/external_objects_java/Makefile" ;;
     "modules/slint/Makefile") CONFIG_FILES="$CONFIG_FILES modules/slint/Makefile" ;;
     "modules/coverage/Makefile") CONFIG_FILES="$CONFIG_FILES modules/coverage/Makefile" ;;
+    "modules/webtools/Makefile") CONFIG_FILES="$CONFIG_FILES modules/webtools/Makefile" ;;
     "modules/Makefile") CONFIG_FILES="$CONFIG_FILES modules/Makefile" ;;
     "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
     "scilab.pc") CONFIG_FILES="$CONFIG_FILES scilab.pc" ;;
index e896f2a..cf2b1ff 100644 (file)
@@ -2102,6 +2102,7 @@ modules/external_objects/Makefile
 modules/external_objects_java/Makefile
 modules/slint/Makefile
 modules/coverage/Makefile
+modules/webtools/Makefile
 modules/Makefile
 Makefile
 scilab.pc
index 8802b36..2194172 100644 (file)
@@ -91,4 +91,5 @@
 <module name="external_objects_java" activate="@JAVA_ENABLE@"/>
 <module name="slint" activate="yes"/>
 <module name="coverage" activate="yes"/>
+<module name="webtools" activate="yes"/>
 </modules>
index e17284e..8373a76 100644 (file)
@@ -89,4 +89,5 @@
     <module name="mpi" activate="no"/>
     <module name="slint" activate="yes"/>
     <module name="coverage" activate="yes"/>
+    <module name="webtools" activate="yes"/>
 </modules>
index bd9f064..16aae24 100644 (file)
@@ -96,7 +96,8 @@ preferences \
 xml \
 external_objects \
 slint \
-coverage
+coverage \
+webtools
 
 if GUI
 SUBDIRS += external_objects_java
@@ -222,7 +223,8 @@ ENGINE_LIBS_DYNAMIC_LOAD = \
        $(top_builddir)/modules/spreadsheet/libscispreadsheet.la \
        $(top_builddir)/modules/umfpack/libsciumfpack.la \
        $(top_builddir)/modules/matio/libscimatio.la \
-       $(top_builddir)/modules/parallel/libsciparallel.la
+       $(top_builddir)/modules/parallel/libsciparallel.la \
+    $(top_builddir)/modules/webtools/libsciwebtools.la
 
 if MPI
 ENGINE_LIBS += $(top_builddir)/modules/mpi/libscimpi.la
index 7bbda27..83a6b2a 100644 (file)
@@ -287,7 +287,7 @@ DIST_SUBDIRS = prebuildjava threads output_stream arnoldi \
        compatibility_functions helptools umfpack demo_tools \
        genetic_algorithms simulated_annealing matio atoms graph ast \
        scinotes parallel modules_manager ui_data history_browser \
-       preferences xml external_objects slint coverage \
+       preferences xml external_objects slint coverage webtools \
        external_objects_java scicos_blocks scicos xcos mpi . javasci
 am__DIST_COMMON = $(srcdir)/Makefile.in \
        $(top_srcdir)/config/mkinstalldirs
@@ -624,8 +624,8 @@ SUBDIRS = prebuildjava threads output_stream arnoldi \
        genetic_algorithms simulated_annealing parameters matio atoms \
        hdf5 graph ast scinotes parallel modules_manager ui_data \
        history_browser preferences xml external_objects slint \
-       coverage $(am__append_1) $(am__append_2) $(am__append_3) \
-       $(am__append_4) . $(am__append_5)
+       coverage webtools $(am__append_1) $(am__append_2) \
+       $(am__append_3) $(am__append_4) . $(am__append_5)
 
 #### Basic files ####
 libscilab_la_rootdir = $(mydatadir)
@@ -726,7 +726,8 @@ ENGINE_LIBS_DYNAMIC_LOAD = \
        $(top_builddir)/modules/spreadsheet/libscispreadsheet.la \
        $(top_builddir)/modules/umfpack/libsciumfpack.la \
        $(top_builddir)/modules/matio/libscimatio.la \
-       $(top_builddir)/modules/parallel/libsciparallel.la
+       $(top_builddir)/modules/parallel/libsciparallel.la \
+    $(top_builddir)/modules/webtools/libsciwebtools.la
 
 
 # Core modules
index 698178c..3260bbf 100644 (file)
@@ -250,4 +250,10 @@ public :
     static int Load();
 };
 
+class WebtoolsModule : public GenericModule
+{
+public :
+    static int Load();
+};
+
 #endif /* !__DYNAMIC_MODULES_HXX_ */
index 994d460..2b05346 100644 (file)
@@ -808,3 +808,21 @@ int HistoryBrowserModule ::Load()
     return 1;
 }
 
+int WebtoolsModule::Load()
+{
+    std::wstring wstModuleName = L"webtools";
+#ifdef _MSC_VER
+    wchar_t* pwstLibName = buildModuleDynLibraryNameW(wstModuleName.c_str(), DYNLIB_NAME_FORMAT_1);
+#else
+    wchar_t* pwstLibName = buildModuleDynLibraryNameW(wstModuleName.c_str(), DYNLIB_NAME_FORMAT_3);
+#endif
+    vectGateway vect = loadGatewaysName(wstModuleName);
+
+    for (int i = 0 ; i < (int)vect.size() ; i++)
+    {
+        symbol::Context::getInstance()->addFunction(types::Function::createFunction(vect[i].wstFunction, vect[i].wstName, pwstLibName, vect[i].iType, NULL, wstModuleName));
+    }
+
+    FREE(pwstLibName);
+    return 1;
+}
index cb9959f..d6e14a4 100644 (file)
@@ -381,6 +381,7 @@ bool FuncManager::CreateModuleList(void)
     m_ModuleMap[L"tclsci"] = std::pair<GW_MOD, GW_MOD>(&TclsciModule::Load, &TclsciModule::Unload);
     m_ModuleMap[L"jvm"] = std::pair<GW_MOD, GW_MOD>(&JvmModule::Load, &JvmModule::Unload);
     m_ModuleMap[L"ui_data"] = std::pair<GW_MOD, GW_MOD>(&UiDataModule::Load, &UiDataModule::Unload);
+    m_ModuleMap[L"webtools"] = std::pair<GW_MOD, GW_MOD>(&WebtoolsModule::Load, &WebtoolsModule::Unload);
 
 #ifdef _MSC_VER
     m_ModuleMap[L"windows_tools"] = std::pair<GW_MOD, GW_MOD>(&WindowsToolsModule::Load, &WindowsToolsModule::Unload);
diff --git a/scilab/modules/webtools/Makefile.am b/scilab/modules/webtools/Makefile.am
new file mode 100644 (file)
index 0000000..0a47809
--- /dev/null
@@ -0,0 +1,86 @@
+# Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+# Copyright (C) 2017 - ESI-Group - Cedric Delamarre
+#
+# This file is distributed under the same license as the Scilab package.
+
+
+WEBTOOLS_C_SOURCES = \
+    src/c/DllmainWebtools.c \
+    src/c/jsmn.c
+
+WEBTOOLS_CPP_SOURCES = \
+    src/cpp/sciCurl.cpp \
+    src/cpp/webtools.cpp \
+    src/cpp/json.cpp
+
+GATEWAY_CPP_SOURCES = \
+    sci_gateway/cpp/sci_http_get.cpp \
+    sci_gateway/cpp/sci_http_put.cpp \
+    sci_gateway/cpp/sci_http_post.cpp \
+    sci_gateway/cpp/sci_http_patch.cpp \
+    sci_gateway/cpp/sci_http_put_post.cpp \
+    sci_gateway/cpp/sci_http_delete.cpp \
+    sci_gateway/cpp/sci_http_upload.cpp \
+    sci_gateway/cpp/sci_toJSON.cpp \
+    sci_gateway/cpp/sci_fromJSON.cpp \
+    sci_gateway/cpp/checkCommonOpt.cpp
+
+libsciwebtools_la_CPPFLAGS= \
+    -I$(srcdir)/includes/ \
+    -I$(srcdir)/src/cpp/ \
+    -I$(srcdir)/src/c/ \
+    -I$(top_srcdir)/modules/ast/includes/ast/ \
+    -I$(top_srcdir)/modules/ast/includes/exps/ \
+    -I$(top_srcdir)/modules/ast/includes/operations/ \
+    -I$(top_srcdir)/modules/ast/includes/parse/ \
+    -I$(top_srcdir)/modules/ast/includes/symbol/ \
+    -I$(top_srcdir)/modules/ast/includes/system_env/ \
+    -I$(top_srcdir)/modules/ast/includes/types/ \
+    -I$(top_srcdir)/modules/ast/includes/analysis/ \
+    -I$(top_srcdir)/modules/output_stream/includes/ \
+    -I$(top_srcdir)/modules/fileio/includes \
+    -I$(top_srcdir)/modules/localization/includes/ \
+    -I$(top_srcdir)/modules/string/includes \
+    -I$(top_srcdir)/modules/dynamic_link/includes \
+    -I$(top_srcdir)/modules/api_scilab/includes \
+    -I$(top_srcdir)/modules/preferences/includes \
+    $(CURL_CFLAGS) \
+    $(AM_CPPFLAGS)
+
+libsciwebtools_algo_la_CPPFLAGS = $(libsciwebtools_la_CPPFLAGS)
+
+pkglib_LTLIBRARIES = libsciwebtools.la
+noinst_LTLIBRARIES = libsciwebtools-algo.la
+
+libsciwebtools_algo_la_LDFLAGS = $(CURL_LIBS)
+libsciwebtools_algo_la_SOURCES = $(WEBTOOLS_CPP_SOURCES) $(WEBTOOLS_C_SOURCES)
+
+libsciwebtools_la_SOURCES = $(GATEWAY_CPP_SOURCES)
+libsciwebtools_la_LIBADD = libsciwebtools-algo.la
+
+# For the code check (splint)
+CHECK_SRC= $(libsciwebtools_la_SOURCES)
+INCLUDE_FLAGS = $(libsciwebtools_la_CPPFLAGS)
+
+
+#### Target ######
+modulename=webtools
+
+
+#### webtools : Conf files ####
+libsciwebtools_la_rootdir = $(mydatadir)
+libsciwebtools_la_root_DATA =  license.txt
+
+
+#### webtools : init scripts ####
+libsciwebtools_la_etcdir = $(mydatadir)/etc
+libsciwebtools_la_etc_DATA = etc/webtools.quit etc/webtools.start
+
+#### webtools : gateway declaration ####
+libsciwebtools_la_sci_gatewaydir = $(mydatadir)/sci_gateway
+libsciwebtools_la_sci_gateway_DATA = sci_gateway/webtools_gateway.xml
+
+#### webtools : include files ####
+libsciwebtools_la_includedir=$(pkgincludedir)
+
+include $(top_srcdir)/Makefile.incl.am
diff --git a/scilab/modules/webtools/Makefile.in b/scilab/modules/webtools/Makefile.in
new file mode 100644 (file)
index 0000000..1c93631
--- /dev/null
@@ -0,0 +1,1579 @@
+# Makefile.in generated by automake 1.15 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+# Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+# Copyright (C) 2017 - ESI-Group - Cedric Delamarre
+#
+# This file is distributed under the same license as the Scilab package.
+
+# Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+# Copyright (C) 2006-2008 - INRIA - Sylvestre LEDRU <sylvestre.ledru@inria.fr>
+# Copyright (C) 2008      - INRIA - Pierre MARECHAL <pierre.marechal@inria.fr>
+#
+# Copyright (C) 2012 - 2016 - Scilab Enterprises
+#
+# This file is hereby licensed under the terms of the GNU GPL v2.0,
+# pursuant to article 5.3.4 of the CeCILL v.2.1.
+# This file was originally licensed under the terms of the CeCILL v2.1,
+# and continues to be available under such terms.
+# For more information, see the COPYING file which you should have received
+# along with this program.
+#
+
+##########
+### Makefile included stuff
+### Target, variable, suffixes which are supposed to be useful in every makefile.am
+##########
+
+
+VPATH = @srcdir@
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
+    case $$MAKEFLAGS in \
+      *\\[\ \  ]*) \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs  ]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+@NEED_JAVA_TRUE@am__append_1 = java
+subdir = modules/webtools
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_compile_stdcxx_11.m4 \
+       $(top_srcdir)/m4/backtrace.m4 $(top_srcdir)/m4/compiler.m4 \
+       $(top_srcdir)/m4/curl.m4 $(top_srcdir)/m4/docbook.m4 \
+       $(top_srcdir)/m4/doxygen.m4 $(top_srcdir)/m4/eigen.m4 \
+       $(top_srcdir)/m4/fftw.m4 $(top_srcdir)/m4/fortran.m4 \
+       $(top_srcdir)/m4/giws.m4 $(top_srcdir)/m4/hdf5.m4 \
+       $(top_srcdir)/m4/intel_compiler.m4 \
+       $(top_srcdir)/m4/java-thirdparty.m4 $(top_srcdir)/m4/java.m4 \
+       $(top_srcdir)/m4/largefile.m4 $(top_srcdir)/m4/lib-ld.m4 \
+       $(top_srcdir)/m4/libsmath.m4 $(top_srcdir)/m4/libtool.m4 \
+       $(top_srcdir)/m4/libxml2.m4 $(top_srcdir)/m4/ltoptions.m4 \
+       $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
+       $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/macosx.m4 \
+       $(top_srcdir)/m4/mpi.m4 $(top_srcdir)/m4/ocaml.m4 \
+       $(top_srcdir)/m4/pcre.m4 $(top_srcdir)/m4/pkg.m4 \
+       $(top_srcdir)/m4/relocatable.m4 $(top_srcdir)/m4/swig.m4 \
+       $(top_srcdir)/m4/symlinks.m4 $(top_srcdir)/m4/tcltk.m4 \
+       $(top_srcdir)/m4/umfpack.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
+mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/modules/core/includes/machine.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(pkglibdir)" \
+       "$(DESTDIR)$(libsciwebtools_la_etcdir)" \
+       "$(DESTDIR)$(libsciwebtools_la_rootdir)" \
+       "$(DESTDIR)$(libsciwebtools_la_sci_gatewaydir)"
+LTLIBRARIES = $(noinst_LTLIBRARIES) $(pkglib_LTLIBRARIES)
+libsciwebtools_algo_la_LIBADD =
+am__dirstamp = $(am__leading_dot)dirstamp
+am__objects_1 = src/cpp/libsciwebtools_algo_la-sciCurl.lo \
+       src/cpp/libsciwebtools_algo_la-webtools.lo \
+       src/cpp/libsciwebtools_algo_la-json.lo
+am__objects_2 = src/c/libsciwebtools_algo_la-DllmainWebtools.lo \
+       src/c/libsciwebtools_algo_la-jsmn.lo
+am_libsciwebtools_algo_la_OBJECTS = $(am__objects_1) $(am__objects_2)
+libsciwebtools_algo_la_OBJECTS = $(am_libsciwebtools_algo_la_OBJECTS)
+AM_V_lt = $(am__v_lt_@AM_V@)
+am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 = 
+libsciwebtools_algo_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \
+       $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \
+       $(AM_CXXFLAGS) $(CXXFLAGS) $(libsciwebtools_algo_la_LDFLAGS) \
+       $(LDFLAGS) -o $@
+libsciwebtools_la_DEPENDENCIES = libsciwebtools-algo.la
+am__objects_3 = sci_gateway/cpp/libsciwebtools_la-sci_http_get.lo \
+       sci_gateway/cpp/libsciwebtools_la-sci_http_put.lo \
+       sci_gateway/cpp/libsciwebtools_la-sci_http_post.lo \
+       sci_gateway/cpp/libsciwebtools_la-sci_http_patch.lo \
+       sci_gateway/cpp/libsciwebtools_la-sci_http_put_post.lo \
+       sci_gateway/cpp/libsciwebtools_la-sci_http_delete.lo \
+       sci_gateway/cpp/libsciwebtools_la-sci_http_upload.lo \
+       sci_gateway/cpp/libsciwebtools_la-sci_toJSON.lo \
+       sci_gateway/cpp/libsciwebtools_la-sci_fromJSON.lo \
+       sci_gateway/cpp/libsciwebtools_la-checkCommonOpt.lo
+am_libsciwebtools_la_OBJECTS = $(am__objects_3)
+libsciwebtools_la_OBJECTS = $(am_libsciwebtools_la_OBJECTS)
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/modules/core/includes
+depcomp = $(SHELL) $(top_srcdir)/config/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+       $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+       $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+       $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo "  CC      " $@;
+am__v_CC_1 = 
+CCLD = $(CC)
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+       $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo "  CCLD    " $@;
+am__v_CCLD_1 = 
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+       $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \
+       $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+       $(AM_CXXFLAGS) $(CXXFLAGS)
+AM_V_CXX = $(am__v_CXX_@AM_V@)
+am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@)
+am__v_CXX_0 = @echo "  CXX     " $@;
+am__v_CXX_1 = 
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+       $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CXXLD = $(am__v_CXXLD_@AM_V@)
+am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@)
+am__v_CXXLD_0 = @echo "  CXXLD   " $@;
+am__v_CXXLD_1 = 
+SOURCES = $(libsciwebtools_algo_la_SOURCES) \
+       $(libsciwebtools_la_SOURCES)
+DIST_SOURCES = $(libsciwebtools_algo_la_SOURCES) \
+       $(libsciwebtools_la_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+DATA = $(libsciwebtools_la_etc_DATA) $(libsciwebtools_la_root_DATA) \
+       $(libsciwebtools_la_sci_gateway_DATA)
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates.  Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/Makefile.incl.am \
+       $(top_srcdir)/config/depcomp \
+       $(top_srcdir)/config/mkinstalldirs
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALL_LINGUAS = @ALL_LINGUAS@
+ALL_LINGUAS_DOC = @ALL_LINGUAS_DOC@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+ANT = @ANT@
+ANTLR = @ANTLR@
+AR = @AR@
+ARPACK_LIBS = @ARPACK_LIBS@
+ASM3 = @ASM3@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AVALON_FRAMEWORK = @AVALON_FRAMEWORK@
+AWK = @AWK@
+BATIK = @BATIK@
+BLAS_CFLAGS = @BLAS_CFLAGS@
+BLAS_LIBS = @BLAS_LIBS@
+CC = @CC@
+CCACHE = @CCACHE@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CHECKSTYLE = @CHECKSTYLE@
+COBERTURA = @COBERTURA@
+COMMONS_BEANUTILS = @COMMONS_BEANUTILS@
+COMMONS_IO = @COMMONS_IO@
+COMMONS_LOGGING = @COMMONS_LOGGING@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CURL_CFLAGS = @CURL_CFLAGS@
+CURL_CONFIG = @CURL_CONFIG@
+CURL_LIBS = @CURL_LIBS@
+CURL_VERSION = @CURL_VERSION@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEMOTOOLS_ENABLE = @DEMOTOOLS_ENABLE@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DOCBOOK_ROOT = @DOCBOOK_ROOT@
+DOXYGEN_BIN = @DOXYGEN_BIN@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+ECJ = @ECJ@
+EGREP = @EGREP@
+EIGEN_CPPFLAGS = @EIGEN_CPPFLAGS@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FFTW3_LIB = @FFTW3_LIB@
+FFTW_ENABLE = @FFTW_ENABLE@
+FGREP = @FGREP@
+FLEXDOCK = @FLEXDOCK@
+FLIBS = @FLIBS@
+FOP = @FOP@
+FREEHEP_GRAPHICS2D = @FREEHEP_GRAPHICS2D@
+FREEHEP_GRAPHICSIO = @FREEHEP_GRAPHICSIO@
+FREEHEP_GRAPHICSIO_EMF = @FREEHEP_GRAPHICSIO_EMF@
+FREEHEP_IO = @FREEHEP_IO@
+FREEHEP_UTIL = @FREEHEP_UTIL@
+GENHTML = @GENHTML@
+GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
+GIWS_BIN = @GIWS_BIN@
+GLUEGEN2_RT = @GLUEGEN2_RT@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GRAPHICS_ENABLE = @GRAPHICS_ENABLE@
+GREP = @GREP@
+GUI_ENABLE = @GUI_ENABLE@
+HAMCREST = @HAMCREST@
+HAVE_CXX11 = @HAVE_CXX11@
+HDF5_CFLAGS = @HDF5_CFLAGS@
+HDF5_LIBS = @HDF5_LIBS@
+HELP_ENABLE = @HELP_ENABLE@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+JAR = @JAR@
+JAVA = @JAVA@
+JAVAC = @JAVAC@
+JAVAC_DEBUG = @JAVAC_DEBUG@
+JAVADOC = @JAVADOC@
+JAVAH = @JAVAH@
+JAVASCI_ENABLE = @JAVASCI_ENABLE@
+JAVA_ENABLE = @JAVA_ENABLE@
+JAVA_G = @JAVA_G@
+JAVA_HOME = @JAVA_HOME@
+JAVA_JNI_INCLUDE = @JAVA_JNI_INCLUDE@
+JAVA_JNI_LIBS = @JAVA_JNI_LIBS@
+JDB = @JDB@
+JEUCLID_CORE = @JEUCLID_CORE@
+JGRAPHX = @JGRAPHX@
+JHALL = @JHALL@
+JLATEXMATH = @JLATEXMATH@
+JLATEXMATH_FOP = @JLATEXMATH_FOP@
+JOGL2 = @JOGL2@
+JROSETTA_API = @JROSETTA_API@
+JROSETTA_ENGINE = @JROSETTA_ENGINE@
+JUNIT4 = @JUNIT4@
+LAPACK_LIBS = @LAPACK_LIBS@
+LCOV = @LCOV@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBM = @LIBM@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LOGGING_LEVEL = @LOGGING_LEVEL@
+LOOKS = @LOOKS@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LUCENE = @LUCENE@
+LUCENE_ANALYZER = @LUCENE_ANALYZER@
+LUCENE_PARSER = @LUCENE_PARSER@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MATIO_CFLAGS = @MATIO_CFLAGS@
+MATIO_ENABLE = @MATIO_ENABLE@
+MATIO_LIBS = @MATIO_LIBS@
+MKDIR_P = @MKDIR_P@
+MPI_ENABLE = @MPI_ENABLE@
+MSGCAT = @MSGCAT@
+MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
+MSGMERGE = @MSGMERGE@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OCAMLC = @OCAMLC@
+OCAMLDEP = @OCAMLDEP@
+OCAMLLEX = @OCAMLLEX@
+OCAMLOPT = @OCAMLOPT@
+OCAMLYACC = @OCAMLYACC@
+OPENMPI_CC = @OPENMPI_CC@
+OPENMPI_CFLAGS = @OPENMPI_CFLAGS@
+OPENMPI_CXX = @OPENMPI_CXX@
+OPENMPI_CXXFLAGS = @OPENMPI_CXXFLAGS@
+OPENMPI_LIBS = @OPENMPI_LIBS@
+OPENMP_CFLAGS = @OPENMP_CFLAGS@
+OPENMP_CXXFLAGS = @OPENMP_CXXFLAGS@
+OPENMP_ENABLE = @OPENMP_ENABLE@
+OPENMP_LIBS = @OPENMP_LIBS@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PCRE_CFLAGS = @PCRE_CFLAGS@
+PCRE_CONFIG = @PCRE_CONFIG@
+PCRE_LIBS = @PCRE_LIBS@
+PCRE_VERSION = @PCRE_VERSION@
+PKG_CONFIG = @PKG_CONFIG@
+POSUB = @POSUB@
+POW_LIB = @POW_LIB@
+PYTHON = @PYTHON@
+RANLIB = @RANLIB@
+RELOCATABLE = @RELOCATABLE@
+RT_LIB = @RT_LIB@
+SAXON = @SAXON@
+SCILAB_BINARY_VERSION = @SCILAB_BINARY_VERSION@
+SCILAB_LIBRARY_VERSION = @SCILAB_LIBRARY_VERSION@
+SCILAB_VERSION_MAINTENANCE = @SCILAB_VERSION_MAINTENANCE@
+SCILAB_VERSION_MAJOR = @SCILAB_VERSION_MAJOR@
+SCILAB_VERSION_MINOR = @SCILAB_VERSION_MINOR@
+SCIRENDERER = @SCIRENDERER@
+SCIRENDERER_CP = @SCIRENDERER_CP@
+SCI_CFLAGS = @SCI_CFLAGS@
+SCI_CXXFLAGS = @SCI_CXXFLAGS@
+SCI_FFLAGS = @SCI_FFLAGS@
+SCI_LDFLAGS = @SCI_LDFLAGS@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SET_RELOCATABLE = @SET_RELOCATABLE@
+SHELL = @SHELL@
+SKINLF = @SKINLF@
+SPLINT = @SPLINT@
+STRIP = @STRIP@
+SWIG_BIN = @SWIG_BIN@
+SWIG_JAVA = @SWIG_JAVA@
+SWIG_RUNTIME_LIBS_DIR = @SWIG_RUNTIME_LIBS_DIR@
+SWIG_SCILAB = @SWIG_SCILAB@
+TCLTK_LIBS = @TCLTK_LIBS@
+TCL_INC_PATH = @TCL_INC_PATH@
+TK_INC_PATH = @TK_INC_PATH@
+UMFPACK_CFLAGS = @UMFPACK_CFLAGS@
+UMFPACK_ENABLE = @UMFPACK_ENABLE@
+UMFPACK_LIB = @UMFPACK_LIB@
+USE_NLS = @USE_NLS@
+VALGRIND_CFLAGS = @VALGRIND_CFLAGS@
+VALGRIND_LIBS = @VALGRIND_LIBS@
+VERSION = @VERSION@
+WITH_OCAML = @WITH_OCAML@
+WITH_TKSCI = @WITH_TKSCI@
+XCOS_ENABLE = @XCOS_ENABLE@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
+XMKMF = @XMKMF@
+XMLGRAPHICS_COMMONS = @XMLGRAPHICS_COMMONS@
+XML_APIS_EXT = @XML_APIS_EXT@
+XML_CONFIG = @XML_CONFIG@
+XML_FLAGS = @XML_FLAGS@
+XML_LIBS = @XML_LIBS@
+XML_VERSION = @XML_VERSION@
+X_CFLAGS = @X_CFLAGS@
+X_EXTRA_LIBS = @X_EXTRA_LIBS@
+X_LIBS = @X_LIBS@
+X_PRE_LIBS = @X_PRE_LIBS@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+ac_ct_F77 = @ac_ct_F77@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+cxx_present = @cxx_present@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+yacc_present = @yacc_present@
+WEBTOOLS_C_SOURCES = \
+    src/c/DllmainWebtools.c \
+    src/c/jsmn.c
+
+WEBTOOLS_CPP_SOURCES = \
+    src/cpp/sciCurl.cpp \
+    src/cpp/webtools.cpp \
+    src/cpp/json.cpp
+
+GATEWAY_CPP_SOURCES = \
+    sci_gateway/cpp/sci_http_get.cpp \
+    sci_gateway/cpp/sci_http_put.cpp \
+    sci_gateway/cpp/sci_http_post.cpp \
+    sci_gateway/cpp/sci_http_patch.cpp \
+    sci_gateway/cpp/sci_http_put_post.cpp \
+    sci_gateway/cpp/sci_http_delete.cpp \
+    sci_gateway/cpp/sci_http_upload.cpp \
+    sci_gateway/cpp/sci_toJSON.cpp \
+    sci_gateway/cpp/sci_fromJSON.cpp \
+    sci_gateway/cpp/checkCommonOpt.cpp
+
+libsciwebtools_la_CPPFLAGS = \
+    -I$(srcdir)/includes/ \
+    -I$(srcdir)/src/cpp/ \
+    -I$(srcdir)/src/c/ \
+    -I$(top_srcdir)/modules/ast/includes/ast/ \
+    -I$(top_srcdir)/modules/ast/includes/exps/ \
+    -I$(top_srcdir)/modules/ast/includes/operations/ \
+    -I$(top_srcdir)/modules/ast/includes/parse/ \
+    -I$(top_srcdir)/modules/ast/includes/symbol/ \
+    -I$(top_srcdir)/modules/ast/includes/system_env/ \
+    -I$(top_srcdir)/modules/ast/includes/types/ \
+    -I$(top_srcdir)/modules/ast/includes/analysis/ \
+    -I$(top_srcdir)/modules/output_stream/includes/ \
+    -I$(top_srcdir)/modules/fileio/includes \
+    -I$(top_srcdir)/modules/localization/includes/ \
+    -I$(top_srcdir)/modules/string/includes \
+    -I$(top_srcdir)/modules/dynamic_link/includes \
+    -I$(top_srcdir)/modules/api_scilab/includes \
+    -I$(top_srcdir)/modules/preferences/includes \
+    $(CURL_CFLAGS) \
+    $(AM_CPPFLAGS)
+
+libsciwebtools_algo_la_CPPFLAGS = $(libsciwebtools_la_CPPFLAGS)
+pkglib_LTLIBRARIES = libsciwebtools.la
+noinst_LTLIBRARIES = libsciwebtools-algo.la
+libsciwebtools_algo_la_LDFLAGS = $(CURL_LIBS)
+libsciwebtools_algo_la_SOURCES = $(WEBTOOLS_CPP_SOURCES) $(WEBTOOLS_C_SOURCES)
+libsciwebtools_la_SOURCES = $(GATEWAY_CPP_SOURCES)
+libsciwebtools_la_LIBADD = libsciwebtools-algo.la
+
+# For the code check (splint)
+CHECK_SRC = $(libsciwebtools_la_SOURCES)
+INCLUDE_FLAGS = $(libsciwebtools_la_CPPFLAGS)
+
+#### Target ######
+modulename = webtools
+
+#### webtools : Conf files ####
+libsciwebtools_la_rootdir = $(mydatadir)
+libsciwebtools_la_root_DATA = license.txt
+
+#### webtools : init scripts ####
+libsciwebtools_la_etcdir = $(mydatadir)/etc
+libsciwebtools_la_etc_DATA = etc/webtools.quit etc/webtools.start
+
+#### webtools : gateway declaration ####
+libsciwebtools_la_sci_gatewaydir = $(mydatadir)/sci_gateway
+libsciwebtools_la_sci_gateway_DATA = sci_gateway/webtools_gateway.xml
+
+#### webtools : include files ####
+libsciwebtools_la_includedir = $(pkgincludedir)
+
+# Where all the Scilab stuff is installed (macros, help, ...)
+mydatadir = $(pkgdatadir)/modules/$(modulename)
+
+# Set AM_* SCI detected settings
+AM_CPPFLAGS = $(SCI_CPPFLAGS)
+AM_CFLAGS = $(SCI_CFLAGS)
+AM_CXXFLAGS = $(SCI_CXXFLAGS)
+# append includes to AM_FFLAGS to manage fortran includes
+AM_FFLAGS = $(SCI_FFLAGS) -I$(top_srcdir)/modules/core/includes/
+
+# Tag shared libraries with the Scilab version
+AM_LDFLAGS = $(SCI_LDFLAGS) -version-number $(SCILAB_LIBRARY_VERSION)
+
+# splint options
+SPLINT_OPTIONS = -weak -booltype BOOL
+
+########################### JAVA ######################################
+#### We are delegating java compilation to ant... Thanks to that
+#### the procedure will be the same with Microsoft Windows (C)
+#### and Linux/Unix
+#######################################################################
+TARGETS_ALL = $(am__append_1)
+
+################ MACROS ######################
+# Rule to build a macro
+# NOT USED  AT THE MOMENT
+SUFFIXES = .sci 
+
+########### INSTALL DOCUMENTATION ###################
+
+# Install documentation files into the right target
+# We do not use the automake mechanism (libxxxx_la_help_fr_DATA) because
+# automake needs the html files to be present which is not the case when
+# we are building Scilab
+
+# Where it should be installed
+pkgdocdir = $(mydatadir)
+
+# What is the mask of the help source
+DOCMASKXML = *.xml
+
+# What is the mask of the MathML sources
+DOCMASKMML = *.mml
+
+########### INSTALL DATA ###################
+# Install macros, help & demos
+# Where it should be installed
+pkgmacrosdir = $(mydatadir)
+# Which directory we process
+MACRODIRS = macros/
+# Mask of the Scilab sources macros
+MACROMASK = *.sci
+# Mask of the Scilab executable sources macros
+MACROBUILDMASK = *.sce
+# Mask of the Scilab compiled macros
+MACROBINMASK = *.bin
+# List of the standard directory for tests
+TESTS_DIR = tests/benchmarks tests/nonreg_tests tests/unit_tests tests/java
+# Where the demos should be installed
+pkgdemosdir = $(mydatadir)
+# List of the standard directory for demos
+DEMOS_DIR = demos
+# List of the standard directory for examples
+EXAMPLES_DIR = examples
+# Where to export JAVA archives (.jar)
+JARDIR = jar/
+# JAR files mask
+JARMASK = *.jar
+# Chapter file 
+HELP_CHAPTERDIR = help/
+HELP_CHAPTERFILE = addchapter.sce
+HELP_CHAPTERLANG = en_US fr_FR pt_BR
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .sci .bin .c .cpp .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/Makefile.incl.am $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+               && { if test -f $@; then exit 0; else break; fi; }; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign modules/webtools/Makefile'; \
+       $(am__cd) $(top_srcdir) && \
+         $(AUTOMAKE) --foreign modules/webtools/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+       @case '$?' in \
+         *config.status*) \
+           cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+         *) \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+       esac;
+$(top_srcdir)/Makefile.incl.am $(am__empty):
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+clean-noinstLTLIBRARIES:
+       -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+       @list='$(noinst_LTLIBRARIES)'; \
+       locs=`for p in $$list; do echo $$p; done | \
+             sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+             sort -u`; \
+       test -z "$$locs" || { \
+         echo rm -f $${locs}; \
+         rm -f $${locs}; \
+       }
+
+install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
+       @$(NORMAL_INSTALL)
+       @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+       list2=; for p in $$list; do \
+         if test -f $$p; then \
+           list2="$$list2 $$p"; \
+         else :; fi; \
+       done; \
+       test -z "$$list2" || { \
+         echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
+         echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
+         $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
+       }
+
+uninstall-pkglibLTLIBRARIES:
+       @$(NORMAL_UNINSTALL)
+       @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+       for p in $$list; do \
+         $(am__strip_dir) \
+         echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
+         $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
+       done
+
+clean-pkglibLTLIBRARIES:
+       -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
+       @list='$(pkglib_LTLIBRARIES)'; \
+       locs=`for p in $$list; do echo $$p; done | \
+             sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+             sort -u`; \
+       test -z "$$locs" || { \
+         echo rm -f $${locs}; \
+         rm -f $${locs}; \
+       }
+src/cpp/$(am__dirstamp):
+       @$(MKDIR_P) src/cpp
+       @: > src/cpp/$(am__dirstamp)
+src/cpp/$(DEPDIR)/$(am__dirstamp):
+       @$(MKDIR_P) src/cpp/$(DEPDIR)
+       @: > src/cpp/$(DEPDIR)/$(am__dirstamp)
+src/cpp/libsciwebtools_algo_la-sciCurl.lo: src/cpp/$(am__dirstamp) \
+       src/cpp/$(DEPDIR)/$(am__dirstamp)
+src/cpp/libsciwebtools_algo_la-webtools.lo: src/cpp/$(am__dirstamp) \
+       src/cpp/$(DEPDIR)/$(am__dirstamp)
+src/cpp/libsciwebtools_algo_la-json.lo: src/cpp/$(am__dirstamp) \
+       src/cpp/$(DEPDIR)/$(am__dirstamp)
+src/c/$(am__dirstamp):
+       @$(MKDIR_P) src/c
+       @: > src/c/$(am__dirstamp)
+src/c/$(DEPDIR)/$(am__dirstamp):
+       @$(MKDIR_P) src/c/$(DEPDIR)
+       @: > src/c/$(DEPDIR)/$(am__dirstamp)
+src/c/libsciwebtools_algo_la-DllmainWebtools.lo:  \
+       src/c/$(am__dirstamp) src/c/$(DEPDIR)/$(am__dirstamp)
+src/c/libsciwebtools_algo_la-jsmn.lo: src/c/$(am__dirstamp) \
+       src/c/$(DEPDIR)/$(am__dirstamp)
+
+libsciwebtools-algo.la: $(libsciwebtools_algo_la_OBJECTS) $(libsciwebtools_algo_la_DEPENDENCIES) $(EXTRA_libsciwebtools_algo_la_DEPENDENCIES) 
+       $(AM_V_CXXLD)$(libsciwebtools_algo_la_LINK)  $(libsciwebtools_algo_la_OBJECTS) $(libsciwebtools_algo_la_LIBADD) $(LIBS)
+sci_gateway/cpp/$(am__dirstamp):
+       @$(MKDIR_P) sci_gateway/cpp
+       @: > sci_gateway/cpp/$(am__dirstamp)
+sci_gateway/cpp/$(DEPDIR)/$(am__dirstamp):
+       @$(MKDIR_P) sci_gateway/cpp/$(DEPDIR)
+       @: > sci_gateway/cpp/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/cpp/libsciwebtools_la-sci_http_get.lo:  \
+       sci_gateway/cpp/$(am__dirstamp) \
+       sci_gateway/cpp/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/cpp/libsciwebtools_la-sci_http_put.lo:  \
+       sci_gateway/cpp/$(am__dirstamp) \
+       sci_gateway/cpp/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/cpp/libsciwebtools_la-sci_http_post.lo:  \
+       sci_gateway/cpp/$(am__dirstamp) \
+       sci_gateway/cpp/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/cpp/libsciwebtools_la-sci_http_patch.lo:  \
+       sci_gateway/cpp/$(am__dirstamp) \
+       sci_gateway/cpp/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/cpp/libsciwebtools_la-sci_http_put_post.lo:  \
+       sci_gateway/cpp/$(am__dirstamp) \
+       sci_gateway/cpp/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/cpp/libsciwebtools_la-sci_http_delete.lo:  \
+       sci_gateway/cpp/$(am__dirstamp) \
+       sci_gateway/cpp/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/cpp/libsciwebtools_la-sci_http_upload.lo:  \
+       sci_gateway/cpp/$(am__dirstamp) \
+       sci_gateway/cpp/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/cpp/libsciwebtools_la-sci_toJSON.lo:  \
+       sci_gateway/cpp/$(am__dirstamp) \
+       sci_gateway/cpp/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/cpp/libsciwebtools_la-sci_fromJSON.lo:  \
+       sci_gateway/cpp/$(am__dirstamp) \
+       sci_gateway/cpp/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/cpp/libsciwebtools_la-checkCommonOpt.lo:  \
+       sci_gateway/cpp/$(am__dirstamp) \
+       sci_gateway/cpp/$(DEPDIR)/$(am__dirstamp)
+
+libsciwebtools.la: $(libsciwebtools_la_OBJECTS) $(libsciwebtools_la_DEPENDENCIES) $(EXTRA_libsciwebtools_la_DEPENDENCIES) 
+       $(AM_V_CXXLD)$(CXXLINK) -rpath $(pkglibdir) $(libsciwebtools_la_OBJECTS) $(libsciwebtools_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+       -rm -f *.$(OBJEXT)
+       -rm -f sci_gateway/cpp/*.$(OBJEXT)
+       -rm -f sci_gateway/cpp/*.lo
+       -rm -f src/c/*.$(OBJEXT)
+       -rm -f src/c/*.lo
+       -rm -f src/cpp/*.$(OBJEXT)
+       -rm -f src/cpp/*.lo
+
+distclean-compile:
+       -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libsciwebtools_la-checkCommonOpt.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libsciwebtools_la-sci_fromJSON.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libsciwebtools_la-sci_http_delete.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libsciwebtools_la-sci_http_get.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libsciwebtools_la-sci_http_patch.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libsciwebtools_la-sci_http_post.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libsciwebtools_la-sci_http_put.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libsciwebtools_la-sci_http_put_post.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libsciwebtools_la-sci_http_upload.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libsciwebtools_la-sci_toJSON.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/c/$(DEPDIR)/libsciwebtools_algo_la-DllmainWebtools.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/c/$(DEPDIR)/libsciwebtools_algo_la-jsmn.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/cpp/$(DEPDIR)/libsciwebtools_algo_la-json.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/cpp/$(DEPDIR)/libsciwebtools_algo_la-sciCurl.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/cpp/$(DEPDIR)/libsciwebtools_algo_la-webtools.Plo@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@   $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
+
+.c.obj:
+@am__fastdepCC_TRUE@   $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+@am__fastdepCC_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@   $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
+@am__fastdepCC_TRUE@   $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
+
+src/c/libsciwebtools_algo_la-DllmainWebtools.lo: src/c/DllmainWebtools.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciwebtools_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT src/c/libsciwebtools_algo_la-DllmainWebtools.lo -MD -MP -MF src/c/$(DEPDIR)/libsciwebtools_algo_la-DllmainWebtools.Tpo -c -o src/c/libsciwebtools_algo_la-DllmainWebtools.lo `test -f 'src/c/DllmainWebtools.c' || echo '$(srcdir)/'`src/c/DllmainWebtools.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) src/c/$(DEPDIR)/libsciwebtools_algo_la-DllmainWebtools.Tpo src/c/$(DEPDIR)/libsciwebtools_algo_la-DllmainWebtools.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='src/c/DllmainWebtools.c' object='src/c/libsciwebtools_algo_la-DllmainWebtools.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciwebtools_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o src/c/libsciwebtools_algo_la-DllmainWebtools.lo `test -f 'src/c/DllmainWebtools.c' || echo '$(srcdir)/'`src/c/DllmainWebtools.c
+
+src/c/libsciwebtools_algo_la-jsmn.lo: src/c/jsmn.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciwebtools_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT src/c/libsciwebtools_algo_la-jsmn.lo -MD -MP -MF src/c/$(DEPDIR)/libsciwebtools_algo_la-jsmn.Tpo -c -o src/c/libsciwebtools_algo_la-jsmn.lo `test -f 'src/c/jsmn.c' || echo '$(srcdir)/'`src/c/jsmn.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) src/c/$(DEPDIR)/libsciwebtools_algo_la-jsmn.Tpo src/c/$(DEPDIR)/libsciwebtools_algo_la-jsmn.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='src/c/jsmn.c' object='src/c/libsciwebtools_algo_la-jsmn.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciwebtools_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o src/c/libsciwebtools_algo_la-jsmn.lo `test -f 'src/c/jsmn.c' || echo '$(srcdir)/'`src/c/jsmn.c
+
+.cpp.o:
+@am__fastdepCXX_TRUE@  $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+@am__fastdepCXX_TRUE@  $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCXX_TRUE@  $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@  $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+@am__fastdepCXX_TRUE@  $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+@am__fastdepCXX_TRUE@  $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+@am__fastdepCXX_TRUE@  $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
+@am__fastdepCXX_TRUE@  $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCXX_TRUE@  $(am__mv) $$depbase.Tpo $$depbase.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $<
+
+src/cpp/libsciwebtools_algo_la-sciCurl.lo: src/cpp/sciCurl.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciwebtools_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/cpp/libsciwebtools_algo_la-sciCurl.lo -MD -MP -MF src/cpp/$(DEPDIR)/libsciwebtools_algo_la-sciCurl.Tpo -c -o src/cpp/libsciwebtools_algo_la-sciCurl.lo `test -f 'src/cpp/sciCurl.cpp' || echo '$(srcdir)/'`src/cpp/sciCurl.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_at)$(am__mv) src/cpp/$(DEPDIR)/libsciwebtools_algo_la-sciCurl.Tpo src/cpp/$(DEPDIR)/libsciwebtools_algo_la-sciCurl.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     $(AM_V_CXX)source='src/cpp/sciCurl.cpp' object='src/cpp/libsciwebtools_algo_la-sciCurl.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciwebtools_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/cpp/libsciwebtools_algo_la-sciCurl.lo `test -f 'src/cpp/sciCurl.cpp' || echo '$(srcdir)/'`src/cpp/sciCurl.cpp
+
+src/cpp/libsciwebtools_algo_la-webtools.lo: src/cpp/webtools.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciwebtools_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/cpp/libsciwebtools_algo_la-webtools.lo -MD -MP -MF src/cpp/$(DEPDIR)/libsciwebtools_algo_la-webtools.Tpo -c -o src/cpp/libsciwebtools_algo_la-webtools.lo `test -f 'src/cpp/webtools.cpp' || echo '$(srcdir)/'`src/cpp/webtools.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_at)$(am__mv) src/cpp/$(DEPDIR)/libsciwebtools_algo_la-webtools.Tpo src/cpp/$(DEPDIR)/libsciwebtools_algo_la-webtools.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     $(AM_V_CXX)source='src/cpp/webtools.cpp' object='src/cpp/libsciwebtools_algo_la-webtools.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciwebtools_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/cpp/libsciwebtools_algo_la-webtools.lo `test -f 'src/cpp/webtools.cpp' || echo '$(srcdir)/'`src/cpp/webtools.cpp
+
+src/cpp/libsciwebtools_algo_la-json.lo: src/cpp/json.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciwebtools_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/cpp/libsciwebtools_algo_la-json.lo -MD -MP -MF src/cpp/$(DEPDIR)/libsciwebtools_algo_la-json.Tpo -c -o src/cpp/libsciwebtools_algo_la-json.lo `test -f 'src/cpp/json.cpp' || echo '$(srcdir)/'`src/cpp/json.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_at)$(am__mv) src/cpp/$(DEPDIR)/libsciwebtools_algo_la-json.Tpo src/cpp/$(DEPDIR)/libsciwebtools_algo_la-json.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     $(AM_V_CXX)source='src/cpp/json.cpp' object='src/cpp/libsciwebtools_algo_la-json.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciwebtools_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/cpp/libsciwebtools_algo_la-json.lo `test -f 'src/cpp/json.cpp' || echo '$(srcdir)/'`src/cpp/json.cpp
+
+sci_gateway/cpp/libsciwebtools_la-sci_http_get.lo: sci_gateway/cpp/sci_http_get.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciwebtools_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT sci_gateway/cpp/libsciwebtools_la-sci_http_get.lo -MD -MP -MF sci_gateway/cpp/$(DEPDIR)/libsciwebtools_la-sci_http_get.Tpo -c -o sci_gateway/cpp/libsciwebtools_la-sci_http_get.lo `test -f 'sci_gateway/cpp/sci_http_get.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_http_get.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_at)$(am__mv) sci_gateway/cpp/$(DEPDIR)/libsciwebtools_la-sci_http_get.Tpo sci_gateway/cpp/$(DEPDIR)/libsciwebtools_la-sci_http_get.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     $(AM_V_CXX)source='sci_gateway/cpp/sci_http_get.cpp' object='sci_gateway/cpp/libsciwebtools_la-sci_http_get.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciwebtools_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o sci_gateway/cpp/libsciwebtools_la-sci_http_get.lo `test -f 'sci_gateway/cpp/sci_http_get.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_http_get.cpp
+
+sci_gateway/cpp/libsciwebtools_la-sci_http_put.lo: sci_gateway/cpp/sci_http_put.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciwebtools_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT sci_gateway/cpp/libsciwebtools_la-sci_http_put.lo -MD -MP -MF sci_gateway/cpp/$(DEPDIR)/libsciwebtools_la-sci_http_put.Tpo -c -o sci_gateway/cpp/libsciwebtools_la-sci_http_put.lo `test -f 'sci_gateway/cpp/sci_http_put.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_http_put.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_at)$(am__mv) sci_gateway/cpp/$(DEPDIR)/libsciwebtools_la-sci_http_put.Tpo sci_gateway/cpp/$(DEPDIR)/libsciwebtools_la-sci_http_put.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     $(AM_V_CXX)source='sci_gateway/cpp/sci_http_put.cpp' object='sci_gateway/cpp/libsciwebtools_la-sci_http_put.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciwebtools_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o sci_gateway/cpp/libsciwebtools_la-sci_http_put.lo `test -f 'sci_gateway/cpp/sci_http_put.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_http_put.cpp
+
+sci_gateway/cpp/libsciwebtools_la-sci_http_post.lo: sci_gateway/cpp/sci_http_post.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciwebtools_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT sci_gateway/cpp/libsciwebtools_la-sci_http_post.lo -MD -MP -MF sci_gateway/cpp/$(DEPDIR)/libsciwebtools_la-sci_http_post.Tpo -c -o sci_gateway/cpp/libsciwebtools_la-sci_http_post.lo `test -f 'sci_gateway/cpp/sci_http_post.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_http_post.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_at)$(am__mv) sci_gateway/cpp/$(DEPDIR)/libsciwebtools_la-sci_http_post.Tpo sci_gateway/cpp/$(DEPDIR)/libsciwebtools_la-sci_http_post.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     $(AM_V_CXX)source='sci_gateway/cpp/sci_http_post.cpp' object='sci_gateway/cpp/libsciwebtools_la-sci_http_post.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciwebtools_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o sci_gateway/cpp/libsciwebtools_la-sci_http_post.lo `test -f 'sci_gateway/cpp/sci_http_post.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_http_post.cpp
+
+sci_gateway/cpp/libsciwebtools_la-sci_http_patch.lo: sci_gateway/cpp/sci_http_patch.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciwebtools_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT sci_gateway/cpp/libsciwebtools_la-sci_http_patch.lo -MD -MP -MF sci_gateway/cpp/$(DEPDIR)/libsciwebtools_la-sci_http_patch.Tpo -c -o sci_gateway/cpp/libsciwebtools_la-sci_http_patch.lo `test -f 'sci_gateway/cpp/sci_http_patch.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_http_patch.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_at)$(am__mv) sci_gateway/cpp/$(DEPDIR)/libsciwebtools_la-sci_http_patch.Tpo sci_gateway/cpp/$(DEPDIR)/libsciwebtools_la-sci_http_patch.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     $(AM_V_CXX)source='sci_gateway/cpp/sci_http_patch.cpp' object='sci_gateway/cpp/libsciwebtools_la-sci_http_patch.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciwebtools_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o sci_gateway/cpp/libsciwebtools_la-sci_http_patch.lo `test -f 'sci_gateway/cpp/sci_http_patch.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_http_patch.cpp
+
+sci_gateway/cpp/libsciwebtools_la-sci_http_put_post.lo: sci_gateway/cpp/sci_http_put_post.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciwebtools_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT sci_gateway/cpp/libsciwebtools_la-sci_http_put_post.lo -MD -MP -MF sci_gateway/cpp/$(DEPDIR)/libsciwebtools_la-sci_http_put_post.Tpo -c -o sci_gateway/cpp/libsciwebtools_la-sci_http_put_post.lo `test -f 'sci_gateway/cpp/sci_http_put_post.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_http_put_post.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_at)$(am__mv) sci_gateway/cpp/$(DEPDIR)/libsciwebtools_la-sci_http_put_post.Tpo sci_gateway/cpp/$(DEPDIR)/libsciwebtools_la-sci_http_put_post.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     $(AM_V_CXX)source='sci_gateway/cpp/sci_http_put_post.cpp' object='sci_gateway/cpp/libsciwebtools_la-sci_http_put_post.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciwebtools_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o sci_gateway/cpp/libsciwebtools_la-sci_http_put_post.lo `test -f 'sci_gateway/cpp/sci_http_put_post.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_http_put_post.cpp
+
+sci_gateway/cpp/libsciwebtools_la-sci_http_delete.lo: sci_gateway/cpp/sci_http_delete.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciwebtools_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT sci_gateway/cpp/libsciwebtools_la-sci_http_delete.lo -MD -MP -MF sci_gateway/cpp/$(DEPDIR)/libsciwebtools_la-sci_http_delete.Tpo -c -o sci_gateway/cpp/libsciwebtools_la-sci_http_delete.lo `test -f 'sci_gateway/cpp/sci_http_delete.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_http_delete.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_at)$(am__mv) sci_gateway/cpp/$(DEPDIR)/libsciwebtools_la-sci_http_delete.Tpo sci_gateway/cpp/$(DEPDIR)/libsciwebtools_la-sci_http_delete.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     $(AM_V_CXX)source='sci_gateway/cpp/sci_http_delete.cpp' object='sci_gateway/cpp/libsciwebtools_la-sci_http_delete.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciwebtools_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o sci_gateway/cpp/libsciwebtools_la-sci_http_delete.lo `test -f 'sci_gateway/cpp/sci_http_delete.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_http_delete.cpp
+
+sci_gateway/cpp/libsciwebtools_la-sci_http_upload.lo: sci_gateway/cpp/sci_http_upload.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciwebtools_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT sci_gateway/cpp/libsciwebtools_la-sci_http_upload.lo -MD -MP -MF sci_gateway/cpp/$(DEPDIR)/libsciwebtools_la-sci_http_upload.Tpo -c -o sci_gateway/cpp/libsciwebtools_la-sci_http_upload.lo `test -f 'sci_gateway/cpp/sci_http_upload.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_http_upload.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_at)$(am__mv) sci_gateway/cpp/$(DEPDIR)/libsciwebtools_la-sci_http_upload.Tpo sci_gateway/cpp/$(DEPDIR)/libsciwebtools_la-sci_http_upload.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     $(AM_V_CXX)source='sci_gateway/cpp/sci_http_upload.cpp' object='sci_gateway/cpp/libsciwebtools_la-sci_http_upload.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciwebtools_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o sci_gateway/cpp/libsciwebtools_la-sci_http_upload.lo `test -f 'sci_gateway/cpp/sci_http_upload.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_http_upload.cpp
+
+sci_gateway/cpp/libsciwebtools_la-sci_toJSON.lo: sci_gateway/cpp/sci_toJSON.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciwebtools_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT sci_gateway/cpp/libsciwebtools_la-sci_toJSON.lo -MD -MP -MF sci_gateway/cpp/$(DEPDIR)/libsciwebtools_la-sci_toJSON.Tpo -c -o sci_gateway/cpp/libsciwebtools_la-sci_toJSON.lo `test -f 'sci_gateway/cpp/sci_toJSON.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_toJSON.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_at)$(am__mv) sci_gateway/cpp/$(DEPDIR)/libsciwebtools_la-sci_toJSON.Tpo sci_gateway/cpp/$(DEPDIR)/libsciwebtools_la-sci_toJSON.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     $(AM_V_CXX)source='sci_gateway/cpp/sci_toJSON.cpp' object='sci_gateway/cpp/libsciwebtools_la-sci_toJSON.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciwebtools_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o sci_gateway/cpp/libsciwebtools_la-sci_toJSON.lo `test -f 'sci_gateway/cpp/sci_toJSON.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_toJSON.cpp
+
+sci_gateway/cpp/libsciwebtools_la-sci_fromJSON.lo: sci_gateway/cpp/sci_fromJSON.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciwebtools_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT sci_gateway/cpp/libsciwebtools_la-sci_fromJSON.lo -MD -MP -MF sci_gateway/cpp/$(DEPDIR)/libsciwebtools_la-sci_fromJSON.Tpo -c -o sci_gateway/cpp/libsciwebtools_la-sci_fromJSON.lo `test -f 'sci_gateway/cpp/sci_fromJSON.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_fromJSON.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_at)$(am__mv) sci_gateway/cpp/$(DEPDIR)/libsciwebtools_la-sci_fromJSON.Tpo sci_gateway/cpp/$(DEPDIR)/libsciwebtools_la-sci_fromJSON.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     $(AM_V_CXX)source='sci_gateway/cpp/sci_fromJSON.cpp' object='sci_gateway/cpp/libsciwebtools_la-sci_fromJSON.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciwebtools_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o sci_gateway/cpp/libsciwebtools_la-sci_fromJSON.lo `test -f 'sci_gateway/cpp/sci_fromJSON.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_fromJSON.cpp
+
+sci_gateway/cpp/libsciwebtools_la-checkCommonOpt.lo: sci_gateway/cpp/checkCommonOpt.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciwebtools_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT sci_gateway/cpp/libsciwebtools_la-checkCommonOpt.lo -MD -MP -MF sci_gateway/cpp/$(DEPDIR)/libsciwebtools_la-checkCommonOpt.Tpo -c -o sci_gateway/cpp/libsciwebtools_la-checkCommonOpt.lo `test -f 'sci_gateway/cpp/checkCommonOpt.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/checkCommonOpt.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_at)$(am__mv) sci_gateway/cpp/$(DEPDIR)/libsciwebtools_la-checkCommonOpt.Tpo sci_gateway/cpp/$(DEPDIR)/libsciwebtools_la-checkCommonOpt.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     $(AM_V_CXX)source='sci_gateway/cpp/checkCommonOpt.cpp' object='sci_gateway/cpp/libsciwebtools_la-checkCommonOpt.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciwebtools_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o sci_gateway/cpp/libsciwebtools_la-checkCommonOpt.lo `test -f 'sci_gateway/cpp/checkCommonOpt.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/checkCommonOpt.cpp
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
+       -rm -rf sci_gateway/cpp/.libs sci_gateway/cpp/_libs
+       -rm -rf src/c/.libs src/c/_libs
+       -rm -rf src/cpp/.libs src/cpp/_libs
+install-libsciwebtools_la_etcDATA: $(libsciwebtools_la_etc_DATA)
+       @$(NORMAL_INSTALL)
+       @list='$(libsciwebtools_la_etc_DATA)'; test -n "$(libsciwebtools_la_etcdir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(libsciwebtools_la_etcdir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(libsciwebtools_la_etcdir)" || exit 1; \
+       fi; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; \
+       done | $(am__base_list) | \
+       while read files; do \
+         echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(libsciwebtools_la_etcdir)'"; \
+         $(INSTALL_DATA) $$files "$(DESTDIR)$(libsciwebtools_la_etcdir)" || exit $$?; \
+       done
+
+uninstall-libsciwebtools_la_etcDATA:
+       @$(NORMAL_UNINSTALL)
+       @list='$(libsciwebtools_la_etc_DATA)'; test -n "$(libsciwebtools_la_etcdir)" || list=; \
+       files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+       dir='$(DESTDIR)$(libsciwebtools_la_etcdir)'; $(am__uninstall_files_from_dir)
+install-libsciwebtools_la_rootDATA: $(libsciwebtools_la_root_DATA)
+       @$(NORMAL_INSTALL)
+       @list='$(libsciwebtools_la_root_DATA)'; test -n "$(libsciwebtools_la_rootdir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(libsciwebtools_la_rootdir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(libsciwebtools_la_rootdir)" || exit 1; \
+       fi; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; \
+       done | $(am__base_list) | \
+       while read files; do \
+         echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(libsciwebtools_la_rootdir)'"; \
+         $(INSTALL_DATA) $$files "$(DESTDIR)$(libsciwebtools_la_rootdir)" || exit $$?; \
+       done
+
+uninstall-libsciwebtools_la_rootDATA:
+       @$(NORMAL_UNINSTALL)
+       @list='$(libsciwebtools_la_root_DATA)'; test -n "$(libsciwebtools_la_rootdir)" || list=; \
+       files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+       dir='$(DESTDIR)$(libsciwebtools_la_rootdir)'; $(am__uninstall_files_from_dir)
+install-libsciwebtools_la_sci_gatewayDATA: $(libsciwebtools_la_sci_gateway_DATA)
+       @$(NORMAL_INSTALL)
+       @list='$(libsciwebtools_la_sci_gateway_DATA)'; test -n "$(libsciwebtools_la_sci_gatewaydir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(libsciwebtools_la_sci_gatewaydir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(libsciwebtools_la_sci_gatewaydir)" || exit 1; \
+       fi; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; \
+       done | $(am__base_list) | \
+       while read files; do \
+         echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(libsciwebtools_la_sci_gatewaydir)'"; \
+         $(INSTALL_DATA) $$files "$(DESTDIR)$(libsciwebtools_la_sci_gatewaydir)" || exit $$?; \
+       done
+
+uninstall-libsciwebtools_la_sci_gatewayDATA:
+       @$(NORMAL_UNINSTALL)
+       @list='$(libsciwebtools_la_sci_gateway_DATA)'; test -n "$(libsciwebtools_la_sci_gatewaydir)" || list=; \
+       files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+       dir='$(DESTDIR)$(libsciwebtools_la_sci_gatewaydir)'; $(am__uninstall_files_from_dir)
+
+ID: $(am__tagged_files)
+       $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+       set x; \
+       here=`pwd`; \
+       $(am__define_uniq_tagged_files); \
+       shift; \
+       if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         if test $$# -gt 0; then \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             "$$@" $$unique; \
+         else \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             $$unique; \
+         fi; \
+       fi
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+       $(am__define_uniq_tagged_files); \
+       test -z "$(CTAGS_ARGS)$$unique" \
+         || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+            $$unique
+
+GTAGS:
+       here=`$(am__cd) $(top_builddir) && pwd` \
+         && $(am__cd) $(top_srcdir) \
+         && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+       list='$(am__tagged_files)'; \
+       case "$(srcdir)" in \
+         [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+         *) sdir=$(subdir)/$(srcdir) ;; \
+       esac; \
+       for i in $$list; do \
+         if test -f "$$i"; then \
+           echo "$(subdir)/$$i"; \
+         else \
+           echo "$$sdir/$$i"; \
+         fi; \
+       done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+       @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       list='$(DISTFILES)'; \
+         dist_files=`for file in $$list; do echo $$file; done | \
+         sed -e "s|^$$srcdirstrip/||;t" \
+             -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+       case $$dist_files in \
+         */*) $(MKDIR_P) `echo "$$dist_files" | \
+                          sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+                          sort -u` ;; \
+       esac; \
+       for file in $$dist_files; do \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+           if test -d "$(distdir)/$$file"; then \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+         else \
+           test -f "$(distdir)/$$file" \
+           || cp -p $$d/$$file "$(distdir)/$$file" \
+           || exit 1; \
+         fi; \
+       done
+check-am: all-am
+       $(MAKE) $(AM_MAKEFLAGS) check-local
+check: check-am
+all-am: Makefile $(LTLIBRARIES) $(DATA) all-local
+installdirs:
+       for dir in "$(DESTDIR)$(pkglibdir)" "$(DESTDIR)$(libsciwebtools_la_etcdir)" "$(DESTDIR)$(libsciwebtools_la_rootdir)" "$(DESTDIR)$(libsciwebtools_la_sci_gatewaydir)"; do \
+         test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+       done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+       if test -z '$(STRIP)'; then \
+         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+             install; \
+       else \
+         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+           "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+       fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+       -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+       -rm -f sci_gateway/cpp/$(DEPDIR)/$(am__dirstamp)
+       -rm -f sci_gateway/cpp/$(am__dirstamp)
+       -rm -f src/c/$(DEPDIR)/$(am__dirstamp)
+       -rm -f src/c/$(am__dirstamp)
+       -rm -f src/cpp/$(DEPDIR)/$(am__dirstamp)
+       -rm -f src/cpp/$(am__dirstamp)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-local \
+       clean-noinstLTLIBRARIES clean-pkglibLTLIBRARIES mostlyclean-am
+
+distclean: distclean-am
+       -rm -rf sci_gateway/cpp/$(DEPDIR) src/c/$(DEPDIR) src/cpp/$(DEPDIR)
+       -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+       distclean-local distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-data-local install-libsciwebtools_la_etcDATA \
+       install-libsciwebtools_la_rootDATA \
+       install-libsciwebtools_la_sci_gatewayDATA
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-pkglibLTLIBRARIES
+
+install-html: install-html-am
+
+install-html-am: install-html-local
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+       -rm -rf sci_gateway/cpp/$(DEPDIR) src/c/$(DEPDIR) src/cpp/$(DEPDIR)
+       -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+       mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-libsciwebtools_la_etcDATA \
+       uninstall-libsciwebtools_la_rootDATA \
+       uninstall-libsciwebtools_la_sci_gatewayDATA \
+       uninstall-pkglibLTLIBRARIES
+
+.MAKE: check-am install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am all-local check check-am \
+       check-local clean clean-generic clean-libtool clean-local \
+       clean-noinstLTLIBRARIES clean-pkglibLTLIBRARIES cscopelist-am \
+       ctags ctags-am distclean distclean-compile distclean-generic \
+       distclean-libtool distclean-local distclean-tags distdir dvi \
+       dvi-am html html-am info info-am install install-am \
+       install-data install-data-am install-data-local install-dvi \
+       install-dvi-am install-exec install-exec-am install-html \
+       install-html-am install-html-local install-info \
+       install-info-am install-libsciwebtools_la_etcDATA \
+       install-libsciwebtools_la_rootDATA \
+       install-libsciwebtools_la_sci_gatewayDATA install-man \
+       install-pdf install-pdf-am install-pkglibLTLIBRARIES \
+       install-ps install-ps-am install-strip installcheck \
+       installcheck-am installdirs maintainer-clean \
+       maintainer-clean-generic mostlyclean mostlyclean-compile \
+       mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+       tags tags-am uninstall uninstall-am \
+       uninstall-libsciwebtools_la_etcDATA \
+       uninstall-libsciwebtools_la_rootDATA \
+       uninstall-libsciwebtools_la_sci_gatewayDATA \
+       uninstall-pkglibLTLIBRARIES
+
+.PRECIOUS: Makefile
+
+
+# This target enables tests for Scilab
+check-local: $(top_builddir)/scilab-bin test
+       if test -d $(mydatadir)/tests; then \
+         @COMMAND="try test_run('$(modulename)');catch exit(-1);end;exit(0)"; export LANG=C; $(top_builddir)/bin/scilab -nwni -nb -e "$$COMMAND"; \
+       fi
+check-code:
+       if test -f build.xml; then \
+               $(ANT) checkstyle; \
+       fi
+       if test -x "$(SPLINT)"; then \
+               $(SPLINT) $(SPLINT_OPTIONS) -I$(top_srcdir)/modules/core/includes/ -I$(top_srcdir)/libs/MALLOC/includes/ -I$(top_srcdir)/modules/localization/includes/ $(INCLUDE_FLAGS) $(CHECK_SRC); \
+       fi
+@NEED_JAVA_TRUE@java:
+# Some configurations needs to export JAVA_HOME in the current env
+@NEED_JAVA_TRUE@       @if test "$(JAVA_HOME)"; then export JAVA_HOME=$(JAVA_HOME); fi; \
+@NEED_JAVA_TRUE@       if test -z "$(USEANT)"; then USEANT=0; else USEANT=1; fi; \
+@NEED_JAVA_TRUE@       if test -f build.xml -a $$USEANT -eq 1; then \
+@NEED_JAVA_TRUE@               $(ANT); \
+@NEED_JAVA_TRUE@       fi
+
+@NEED_JAVA_TRUE@clean-java:
+# Some configurations needs to export JAVA_HOME in the current env
+@NEED_JAVA_TRUE@       @if test "$(JAVA_HOME)"; then export JAVA_HOME=$(JAVA_HOME); fi; \
+@NEED_JAVA_TRUE@       if test -z "$(USEANT)"; then USEANT=0; else USEANT=1; fi; \
+@NEED_JAVA_TRUE@       if test -f build.xml -a $$USEANT -eq 1; then \
+@NEED_JAVA_TRUE@               $(ANT) clean; \
+@NEED_JAVA_TRUE@       fi;
+
+# If the user request for the SWIG generation of the wrappers Java => C/C++ 
+# We call the target swig-build on the variable SWIG_WRAPPERS
+
+@SWIG_TRUE@swig: $(SWIG_WRAPPERS)
+@SWIG_TRUE@    @SWIG_PACKAGENAME=org.scilab.modules.$(modulename); \
+@SWIG_TRUE@    SWIG_OUTDIR=src/java/org/scilab/modules/$(modulename)/; \
+@SWIG_TRUE@    if test -n "$(SWIG_WRAPPERS)"; then \
+@SWIG_TRUE@            for file in $(SWIG_WRAPPERS) ; do \
+@SWIG_TRUE@                    echo "Swig process of $$file (Java) ..."; \
+@SWIG_TRUE@                    $(SWIG_BIN) $(SWIG_OPTIONS) $(SWIG_JAVA) -package $$SWIG_PACKAGENAME  -outdir $$SWIG_OUTDIR $$file; \
+@SWIG_TRUE@            done; \
+@SWIG_TRUE@    fi
+
+@SWIG_TRUE@swig-scilab: $(SWIG_SCILAB_WRAPPERS)
+@SWIG_TRUE@    @SWIG_OUTDIR=src/swig/; \
+@SWIG_TRUE@    if test -n "$(SWIG_SCILAB_WRAPPERS)"; then \
+@SWIG_TRUE@            for file in $(SWIG_SCILAB_WRAPPERS) ; do \
+@SWIG_TRUE@                    echo "Swig process of $$file (Scilab) ..."; \
+@SWIG_TRUE@                    $(SWIG_BIN) $(SWIG_OPTIONS) $(SWIG_SCILAB)  -outdir $$SWIG_OUTDIR $$file; \
+@SWIG_TRUE@            done; \
+@SWIG_TRUE@    fi
+
+# If the user request for the SWIG generation of the wrappers Java => C/C++ 
+# We call the target swig-build on the variable SWIG_WRAPPERS
+
+@GIWS_TRUE@giws: $(GIWS_WRAPPERS)
+@GIWS_TRUE@    @GIWS_OUTPUTDIR=src/jni/; \
+@GIWS_TRUE@    MANDATORY_OPTIONS="--throws-exception-on-error --description-file"; \
+@GIWS_TRUE@    if test -n "$(GIWS_WRAPPERS)"; then \
+@GIWS_TRUE@            for file in $(GIWS_WRAPPERS) ; do \
+@GIWS_TRUE@                    echo "GIWS process of $$file ..."; \
+@GIWS_TRUE@                    if test -z "$(GIWS_OPTIONS)"; then \
+@GIWS_TRUE@                            $(GIWS_BIN) --disable-return-size-array --output-dir $$GIWS_OUTPUTDIR $$MANDATORY_OPTIONS $$file; \
+@GIWS_TRUE@                    else \
+@GIWS_TRUE@                            echo "Custom GIWS call with '$$GIWS_OPTIONS'"; \
+@GIWS_TRUE@                            $(GIWS_BIN) $$GIWS_OPTIONS --output-dir $$GIWS_OUTPUTDIR $$MANDATORY_OPTIONS $$file; \
+@GIWS_TRUE@                    fi \
+@GIWS_TRUE@            done; \
+@GIWS_TRUE@    fi
+
+@GIWS_TRUE@giws-exception:
+@GIWS_TRUE@    @GIWS_OUTPUTDIR=src/jni/;\
+@GIWS_TRUE@    echo "GIWS: Generation of exception class ..."; \
+@GIWS_TRUE@    $(GIWS_BIN) --generate-exception-class --output-dir $$GIWS_OUTPUTDIR 
+
+macros:
+       -@( if test ! -x $(top_builddir)/scilab-bin; then \
+               echo "Error : Cannot build $< : Scilab has not been built"; \
+       else \
+               $(top_builddir)/bin/scilab -ns -nwni -e "exec('macros/buildmacros.sce');quit;";\
+       fi)
+
+# Removes the macros
+clean-macros:
+# Removes macros (*.bin generated from .sci)
+       @for dir in $(MACRODIRS) $(MACROSDIRSEXT) ; do \
+               echo "rm -f $(builddir)/$$dir/$(MACROBINMASK)"; \
+               rm -f $(builddir)/$$dir/$(MACROBINMASK); \
+       done
+
+test:
+# More tests could be added here
+       @if test -z "$(USEANT)"; then USEANT=0; else USEANT=1; fi; \
+       if test -f build.xml -a $$USEANT -eq 1; then \
+               $(ANT) test; \
+       fi
+
+all-local: $(TARGETS_ALL)
+
+.sci.bin:
+       -@( if test ! -x $(top_builddir)/scilab-bin; then \
+       echo "Error : Cannot build $< : Scilab has not been build"; \
+       else \
+       echo "Creating $@"; \
+       $(top_builddir)/bin/scilab -ns -nwni -e "exec('$(abs_srcdir)/$<');save('$(abs_srcdir)/$@');exit;"; \
+       fi )
+
+install-html-local:
+
+install-data-local-local:
+# Mainly for javasci
+       @if test -d $(srcdir)/javadoc; then \
+               cp -R $(srcdir)/javadoc $(DESTDIR)/$(mydatadir)/; \
+       fi
+# If the user wants the help sources to be installed
+@INSTALL_HELP_XML_TRUE@        @echo "-------- Install of XML sources of help files --------"; \
+@INSTALL_HELP_XML_TRUE@        for lang in $(ALL_LINGUAS); do \
+@INSTALL_HELP_XML_TRUE@         if test -d $(srcdir)/help/$$lang; then \
+@INSTALL_HELP_XML_TRUE@          $(mkinstalldirs) $(DESTDIR)$(pkgdocdir)/help/$$lang && \
+@INSTALL_HELP_XML_TRUE@                if ls -lLd $(srcdir)/help/$$lang/$(DOCMASKXML) >/dev/null 2>&1; then \
+@INSTALL_HELP_XML_TRUE@                  for file in $(srcdir)/help/$$lang/$(DOCMASKXML) ; do \
+@INSTALL_HELP_XML_TRUE@                    echo "$(INSTALL_DATA) $$file $(DESTDIR)$(pkgdocdir)/help/$$lang" ; \
+@INSTALL_HELP_XML_TRUE@                $(INSTALL_DATA) "$$file" $(DESTDIR)$(pkgdocdir)/help/$$lang ; \
+@INSTALL_HELP_XML_TRUE@                  done ; \
+@INSTALL_HELP_XML_TRUE@                fi; \
+@INSTALL_HELP_XML_TRUE@         fi; \
+@INSTALL_HELP_XML_TRUE@        done; \
+@INSTALL_HELP_XML_TRUE@        @echo "-------- Install of MathML sources --------"; \
+@INSTALL_HELP_XML_TRUE@         if test -d $(srcdir)/help/mml/; then \
+@INSTALL_HELP_XML_TRUE@          $(mkinstalldirs) $(DESTDIR)$(pkgdocdir)/help/mml/ && \
+@INSTALL_HELP_XML_TRUE@                if ls -lLd $(srcdir)/help/mml/$(DOCMASKMML) >/dev/null 2>&1; then \
+@INSTALL_HELP_XML_TRUE@                  for file in $(srcdir)/help/mml/$(DOCMASKMML) ; do \
+@INSTALL_HELP_XML_TRUE@                    echo "$(INSTALL_DATA) $$file $(DESTDIR)$(pkgdocdir)/help/mml" ; \
+@INSTALL_HELP_XML_TRUE@                $(INSTALL_DATA) "$$file" $(DESTDIR)$(pkgdocdir)/help/mml ; \
+@INSTALL_HELP_XML_TRUE@                  done ; \
+@INSTALL_HELP_XML_TRUE@                fi; \
+@INSTALL_HELP_XML_TRUE@        fi
+install-data-local:
+# Install the tests
+       @echo "-------- Install tests (if any) --------"; \
+       for dir in $(TESTS_DIR) $(TESTS_DIREXT) ; do \
+         if test -d $(srcdir)/$$dir/; then \
+           $(mkinstalldirs) $(DESTDIR)$(pkgmacrosdir)/$$dir && \
+                 for file in `find $(srcdir)/$$dir | sed "s|^$(srcdir)/$$dir||" 2>/dev/null`; do \
+                   if test -d "$(srcdir)/$$dir/$$file"; then \
+                         echo $(mkinstalldirs) $(DESTDIR)$(pkgmacrosdir)/$$dir/$$file; \
+                         $(mkinstalldirs) "$(DESTDIR)$(pkgmacrosdir)/$$dir/$$file"; \
+                   else \
+                     echo "$(INSTALL_DATA) $(srcdir)/$$dir/$$file $(DESTDIR)$(pkgmacrosdir)/`dirname $$dir/$$file`" ; \
+                 $(INSTALL_DATA) "$(srcdir)/$$dir/$$file" "$(DESTDIR)$(pkgmacrosdir)/`dirname $$dir/$$file`" ; \
+                   fi \
+                 done; \
+         fi; \
+       done
+# Install the help chapter
+       @echo "-------- Install the help chapter (if any) --------"; \
+       for lang in $(HELP_CHAPTERLANG); do \
+               HELPFILE=$(srcdir)/$(HELP_CHAPTERDIR)$$lang/$(HELP_CHAPTERFILE); \
+               if test -f $$HELPFILE; then \
+                       echo $(mkinstalldirs) $(DESTDIR)$(pkgdocdir)/$(HELP_CHAPTERDIR)/$$lang/; \
+                       $(mkinstalldirs) $(DESTDIR)$(pkgdocdir)/$(HELP_CHAPTERDIR)/$$lang/; \
+                       echo $(INSTALL_DATA) $$HELPFILE $(DESTDIR)$(pkgdocdir)/$$HELPFILE; \
+                       $(INSTALL_DATA) $$HELPFILE $(DESTDIR)$(pkgdocdir)/$$HELPFILE; \
+               fi; \
+       done
+# Install the demos & examples
+       @echo "-------- Install demos & examples (if any) --------"; \
+       for dir in $(DEMOS_DIR) $(DEMOS_DIREXT) $(EXAMPLES_DIR) $(EXAMPLES_DIREXT) ; do \
+         if test -d $(srcdir)/$$dir/; then \
+           $(mkinstalldirs) $(DESTDIR)$(pkgdocdir)/$$dir && \
+                 for file in `find $(srcdir)/$$dir | sed "s|^$(srcdir)/$$dir||" 2>/dev/null`; do \
+                   if test -d "$(srcdir)/$$dir/$$file"; then \
+                         echo $(mkinstalldirs) $(DESTDIR)$(pkgdocdir)/$$dir/$$file; \
+                         $(mkinstalldirs) "$(DESTDIR)$(pkgdocdir)/$$dir/$$file"; \
+                   else \
+                     echo "$(INSTALL_DATA) $(srcdir)/$$dir/$$file $(DESTDIR)$(pkgdocdir)/`dirname $$dir/$$file`" ; \
+                 $(INSTALL_DATA) "$(srcdir)/$$dir/$$file" "$(DESTDIR)$(pkgdocdir)/`dirname $$dir/$$file`" ; \
+                   fi \
+                 done; \
+         fi; \
+       done
+# Install the macros
+       @echo "-------- Install macros (if any) --------"; \
+       for dir in $(MACRODIRS) $(MACROSDIRSEXT) ; do \
+         $(mkinstalldirs) $(DESTDIR)$(pkgmacrosdir)/$$dir && \
+               if test -d $(srcdir)/$$dir/; then \
+                       FILELIST="$(srcdir)/$$dir/$(MACROMASK) $(srcdir)/$$dir/$(MACROBINMASK) $(srcdir)/$$dir/$(MACROBUILDMASK) $(srcdir)/$$dir/names $(srcdir)/$$dir/lib";\
+                       if test -n "$(MACROSSPECIALEXT)"; then \
+                               specialExtDir=""; \
+                               for specialExt in $(MACROSSPECIALEXT); do \
+                                       specialExtDir="$$specialExtDir $(srcdir)/$$dir/$$specialExt"; \
+                               done; \
+                               FILELIST="$$FILELIST $$specialExtDir"; \
+                       fi; \
+                 for file in `ls -1 $$FILELIST 2>/dev/null`; do \
+                   echo "$(INSTALL_DATA) $$file $(DESTDIR)$(pkgmacrosdir)/$$dir" ; \
+               $(INSTALL_DATA) "$$file" $(DESTDIR)$(pkgmacrosdir)/$$dir ; \
+                 done; \
+               fi; \
+       done
+# Install java files (.jar)
+       @if ls -lLd $(srcdir)/$(JARDIR)$(JARMASK) >/dev/null 2>&1; then \
+       echo "-------- Install jar files --------"; \
+    $(mkinstalldirs) $(DESTDIR)$(pkgdocdir)/$(JARDIR); \
+         for file in $(srcdir)/$(JARDIR)$(JARMASK); do\
+                   echo "$(INSTALL_DATA) $$file $(DESTDIR)$(pkgdocdir)/$(JARDIR)" ; \
+               $(INSTALL_DATA) "$$file" $(DESTDIR)$(pkgdocdir)/$(JARDIR) ; \
+         done ; \
+       fi
+
+########### CLEAN ###################
+# Clean help (generated automatically by Scilab)
+# It used to clean the macro (clean-macros) but this was causing
+# make clean && make to fail Scilab startup
+@NEED_JAVA_TRUE@clean-local: clean-java
+@NEED_JAVA_FALSE@clean-local:
+
+distclean-local:
+       rm -f $(builddir)/help/*/.last_successful_build_javaHelp $(builddir)/help/*/.list_*
+
+.PHONY: macros java swig giws
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/scilab/modules/webtools/demos/webtools.dem.gateway.sce b/scilab/modules/webtools/demos/webtools.dem.gateway.sce
new file mode 100644 (file)
index 0000000..27168a0
--- /dev/null
@@ -0,0 +1,18 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2011 - DIGITEO - Allan CORNET
+//
+// This file is released under the 3-clause BSD license. See COPYING-BSD.
+
+function subdemolist = demo_gateway()
+
+    demopath = get_absolute_file_path("webtools.dem.gateway.sce");
+    add_demo(_("Web Tools Demo"), demopath + "webtools.dem.gateway.sce");
+
+    //subdemolist = [_("demo name")  ,"demo.file.sce"]
+
+    //subdemolist(:,2) = demopath + subdemolist(:,2);
+
+endfunction
+
+subdemolist = demo_gateway();
+clear demo_gateway;
diff --git a/scilab/modules/webtools/etc/webtools.quit b/scilab/modules/webtools/etc/webtools.quit
new file mode 100644 (file)
index 0000000..fda6d12
--- /dev/null
@@ -0,0 +1,14 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2007-2008 - INRIA
+// Copyright (C) 2009 - DIGITEO
+// Copyright (C) 2012 - 2016 - Scilab Enterprises
+// Copyright (C) 2017 - ESI-Group
+//
+// This file is hereby licensed under the terms of the GNU GPL v2.0,
+// pursuant to article 5.3.4 of the CeCILL v.2.1.
+// This file was originally licensed under the terms of the CeCILL v2.1,
+// and continues to be available under such terms.
+// For more information, see the COPYING file which you should have received
+// along with this program.
+
+// =============================================================================
diff --git a/scilab/modules/webtools/etc/webtools.start b/scilab/modules/webtools/etc/webtools.start
new file mode 100644 (file)
index 0000000..d76c2d3
--- /dev/null
@@ -0,0 +1,15 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2006 - INRIA - Scilab
+// Copyright (C) 2012 - 2016 - Scilab Enterprises
+// Copyright (C) 2017 - ESI-Group
+//
+// This file is hereby licensed under the terms of the GNU GPL v2.0,
+// pursuant to article 5.3.4 of the CeCILL v.2.1.
+// This file was originally licensed under the terms of the CeCILL v2.1,
+// and continues to be available under such terms.
+// For more information, see the COPYING file which you should have received
+// along with this program.
+
+// Load  functions libraries
+// =============================================================================
+load('SCI/modules/webtools/macros/lib');
diff --git a/scilab/modules/webtools/help/en_US/addchapter.sce b/scilab/modules/webtools/help/en_US/addchapter.sce
new file mode 100644 (file)
index 0000000..a0e1f0b
--- /dev/null
@@ -0,0 +1,14 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2009 - DIGITEO
+//
+// Copyright (C) 2012 - 2016 - Scilab Enterprises
+//
+// This file is hereby licensed under the terms of the GNU GPL v2.0,
+// pursuant to article 5.3.4 of the CeCILL v.2.1.
+// This file was originally licensed under the terms of the CeCILL v2.1,
+// and continues to be available under such terms.
+// For more information, see the COPYING file which you should have received
+// along with this program.
+
+add_help_chapter("Web Tools",SCI+"/modules/webtools/help/en_US",%T);
+
diff --git a/scilab/modules/webtools/help/en_US/fromJSON.xml b/scilab/modules/webtools/help/en_US/fromJSON.xml
new file mode 100644 (file)
index 0000000..f12cdf5
--- /dev/null
@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2017 - ESI-Group
+ *
+ * This file is hereby licensed under the terms of the GNU GPL v2.0,
+ * pursuant to article 5.3.4 of the CeCILL v.2.1.
+ * This file was originally licensed under the terms of the CeCILL v2.1,
+ * and continues to be available under such terms.
+ * For more information, see the COPYING file which you should have received
+ * along with this program.
+ *
+ -->
+
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org"  xml:lang="en" xml:id="fromJSON">
+    <refnamediv>
+        <refname>fromJSON</refname>
+        <refpurpose>
+            Convert JSON to scilab variable.
+        </refpurpose>
+    </refnamediv>
+    <refsynopsisdiv>
+        <title>Syntax</title>
+        <synopsis>
+            result = fromJSON(arg [,type])
+        </synopsis>
+    </refsynopsisdiv>
+    <refsection>
+        <title>Arguments</title>
+        <variablelist>
+            <varlistentry>
+                <term>arg</term>
+                <listitem>
+                    <para>
+                        A string wich contain JSON data, or a filename if the argument "type" is given.
+                    </para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>type</term>
+                <listitem>
+                    <para>
+                        A scalar string wich contain "file".
+                        If this argument is given, the arguement "arg" is the filename wich contain JSON data.
+                    </para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>result</term>
+                <listitem>
+                    <para>
+                        If the string is a correct JSON, result contain the scilab variable.
+                    </para>
+                </listitem>
+            </varlistentry>
+        </variablelist>
+    </refsection>
+    <refsection>
+        <title>Description</title>
+        <para>
+            This function convert string or JSON files into a Scilab variable.
+        </para>
+    </refsection>
+    <refsection>
+        <title>Examples</title>
+        <programlisting role="example"><![CDATA[
+fromJSON("{status: OK, value:12}")
+fromJSON("[1, 2, 3]")
+fromJSON("{test:[a, b], values:[1, 2]")
+ ]]></programlisting>
+    </refsection>
+    <refsection role="see also">
+        <title>See also</title>
+        <simplelist type="inline">
+            <member>
+                <link linkend="http_post">http_post</link>
+            </member>
+            <member>
+                <link linkend="http_put">http_put</link>
+            </member>
+            <member>
+                <link linkend="http_patch">http_patch</link>
+            </member>
+            <member>
+                <link linkend="http_delete">http_delete</link>
+            </member>
+            <member>
+                <link linkend="http_upload">http_upload</link>
+            </member>
+            <member>
+                <link linkend="toJSON">toJSON</link>
+            </member>
+            <member>
+                <link linkend="http_get">http_get</link>
+            </member>
+        </simplelist>
+    </refsection>
+    <refsection>
+        <title>History</title>
+        <revhistory>
+            <revision>
+                <revnumber>6.1</revnumber>
+                <revremark>
+                    Function introduced.
+                </revremark>
+            </revision>
+        </revhistory>
+    </refsection>
+</refentry>
diff --git a/scilab/modules/webtools/help/en_US/http_delete.xml b/scilab/modules/webtools/help/en_US/http_delete.xml
new file mode 100644 (file)
index 0000000..222460a
--- /dev/null
@@ -0,0 +1,150 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2017 - ESI-Group
+ *
+ * This file is hereby licensed under the terms of the GNU GPL v2.0,
+ * pursuant to article 5.3.4 of the CeCILL v.2.1.
+ * This file was originally licensed under the terms of the CeCILL v2.1,
+ * and continues to be available under such terms.
+ * For more information, see the COPYING file which you should have received
+ * along with this program.
+ *
+ -->
+
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org"  xml:lang="en" xml:id="http_delete">
+    <refnamediv>
+        <refname>http_delete</refname>
+        <refpurpose>
+            HTTP DELETE request.
+        </refpurpose>
+    </refnamediv>
+    <refsynopsisdiv>
+        <title>Syntax</title>
+        <synopsis>
+            [result, status] = http_delete(url [, &lt;opt_args&gt;])
+        </synopsis>
+    </refsynopsisdiv>
+    <refsection>
+        <title>Arguments</title>
+        <variablelist>
+            <varlistentry>
+                <term>url</term>
+                <listitem>
+                    <para>
+                        A string containing the server adresse following by the optional port, the route of the request and query datas.
+                        syntax: "adresse:port/route?queryfield=querydata"
+                    </para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>&lt;opt_args&gt;</term>
+                <listitem>
+                    <para>
+                        This represents a sequence of statements
+                        <literal>key1=value1, key2=value2, ...</literal>
+                        where <literal>key1</literal>,
+                        <literal>key2</literal>, ... can be one of the following:
+                    </para>
+                    <variablelist>
+                        <varlistentry>
+                            <term>cert</term>
+                            <listitem>
+                                <para>This option determines whether Scilab verifies the authenticity of the peer's certificate.
+                                    If <literal>none</literal> is given, no verification is performed.
+                                    <warning>
+                                        Disabling verification of the certificate allows bad guys to man-in-the-middle the communication without you knowing it.
+                                        Disabling verification makes the communication insecure.
+                                        Just having encryption on a transfer is not enough as you cannot be sure that you are communicating with the correct end-point.
+                                    </warning>
+                                </para>
+                            </listitem>
+                        </varlistentry>
+                        <varlistentry>
+                            <term>follow</term>
+                            <listitem>
+                                <para>
+                                    By default, <literal>follow</literal> is false. Set <literal>follow=%t</literal> to follow eventual redirections.
+                                </para>
+                            </listitem>
+                        </varlistentry>
+                        <varlistentry>
+                            <term>auth</term>
+                            <listitem>
+                                <para>Username and password can be specified for the websites which required authentication.</para>
+                                <para>
+                                    The syntax is <literal>auth="username:password"</literal>
+                                </para>
+                            </listitem>
+                        </varlistentry>
+                    </variablelist>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>result</term>
+                <listitem>
+                    <para>
+                        Result is a string wich contain the server answer or
+                        a scilab variable if the answer is in JSON format.
+                    </para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>status</term>
+                <listitem>
+                    <para>
+                        HTTP response code.
+                    </para>
+                </listitem>
+            </varlistentry>
+        </variablelist>
+    </refsection>
+    <refsection>
+        <title>Description</title>
+        <para>This function will perform an HTTP DELETE request.</para>
+        <para>The proxy configuration is used if it's enabled in the Preferences under the rubric "Internet".</para>
+    </refsection>
+    <refsection>
+        <title>Examples</title>
+        <programlisting role="example"><![CDATA[
+    http_delete("http://jsonplaceholder.typicode.com/posts/1");
+     ]]></programlisting>
+    </refsection>
+    <refsection role="see also">
+        <title>See also</title>
+        <simplelist type="inline">
+            <member>
+                <link linkend="http_post">http_post</link>
+            </member>
+            <member>
+                <link linkend="http_put">http_put</link>
+            </member>
+            <member>
+                <link linkend="http_patch">http_patch</link>
+            </member>
+            <member>
+                <link linkend="http_get">http_get</link>
+            </member>
+            <member>
+                <link linkend="http_upload">http_upload</link>
+            </member>
+            <member>
+                <link linkend="toJSON">toJSON</link>
+            </member>
+            <member>
+                <link linkend="fromJSON">fromJSON</link>
+            </member>
+        </simplelist>
+    </refsection>
+    <refsection>
+        <title>History</title>
+        <revhistory>
+            <revision>
+                <revnumber>6.1</revnumber>
+                <revremark>
+                    Function introduced.
+                </revremark>
+            </revision>
+        </revhistory>
+    </refsection>
+</refentry>
diff --git a/scilab/modules/webtools/help/en_US/http_get.xml b/scilab/modules/webtools/help/en_US/http_get.xml
new file mode 100644 (file)
index 0000000..98d0bef
--- /dev/null
@@ -0,0 +1,167 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2017 - ESI-Group
+ *
+ * This file is hereby licensed under the terms of the GNU GPL v2.0,
+ * pursuant to article 5.3.4 of the CeCILL v.2.1.
+ * This file was originally licensed under the terms of the CeCILL v2.1,
+ * and continues to be available under such terms.
+ * For more information, see the COPYING file which you should have received
+ * along with this program.
+ *
+ -->
+
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org"  xml:lang="en" xml:id="http_get">
+    <refnamediv>
+        <refname>http_get</refname>
+        <refpurpose>
+            HTTP GET request.
+        </refpurpose>
+    </refnamediv>
+    <refsynopsisdiv>
+        <title>Syntax</title>
+        <synopsis>
+            [result, status] = http_get(url [,filename, &lt;opt_args&gt;])
+        </synopsis>
+    </refsynopsisdiv>
+    <refsection>
+        <title>Arguments</title>
+        <variablelist>
+            <varlistentry>
+                <term>url</term>
+                <listitem>
+                    <para>
+                        A string containing the server adresse following by the optional port, the route of the request and query datas.
+                        syntax: "adresse:port/route?queryfield=querydata"
+                    </para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>filename</term>
+                <listitem>
+                    <para>
+                        If this optional argument is given, the result will be written in the file.
+                        Can be used to download a file.
+                    </para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>&lt;opt_args&gt;</term>
+                <listitem>
+                    <para>
+                        This represents a sequence of statements
+                        <literal>key1=value1, key2=value2, ...</literal>
+                        where <literal>key1</literal>,
+                        <literal>key2</literal>, ... can be one of the following:
+                    </para>
+                    <variablelist>
+                        <varlistentry>
+                            <term>cert</term>
+                            <listitem>
+                                <para>This option determines whether Scilab verifies the authenticity of the peer's certificate.
+                                    If <literal>none</literal> is given, no verification is performed.
+                                    <warning>
+                                        Disabling verification of the certificate allows bad guys to man-in-the-middle the communication without you knowing it.
+                                        Disabling verification makes the communication insecure.
+                                        Just having encryption on a transfer is not enough as you cannot be sure that you are communicating with the correct end-point.
+                                    </warning>
+                                </para>
+                            </listitem>
+                        </varlistentry>
+                        <varlistentry>
+                            <term>follow</term>
+                            <listitem>
+                                <para>
+                                    By default, <literal>follow</literal> is false. Set <literal>follow=%t</literal> to follow eventual redirections.
+                                </para>
+                            </listitem>
+                        </varlistentry>
+                        <varlistentry>
+                            <term>auth</term>
+                            <listitem>
+                                <para>Username and password can be specified for the websites which required authentication.</para>
+                                <para>
+                                    The syntax is <literal>auth="username:password"</literal>
+                                </para>
+                            </listitem>
+                        </varlistentry>
+                    </variablelist>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>result</term>
+                <listitem>
+                    <para>
+                        If a filename is given, result contains the path of the file.
+                        If not, result is a string wich contain the server answer or
+                        a scilab variable if the answer is in JSON format.
+                    </para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>status</term>
+                <listitem>
+                    <para>
+                        HTTP response code.
+                    </para>
+                </listitem>
+            </varlistentry>
+        </variablelist>
+    </refsection>
+    <refsection>
+        <title>Description</title>
+        <para>This function will perform an HTTP GET request.</para>
+        <para>The proxy configuration is used if it's enabled in the Preferences under the rubric "Internet".</para>
+    </refsection>
+    <refsection>
+        <title>Examples</title>
+        <programlisting role="example"><![CDATA[
+result = http_get("www.google.com")
+
+file = http_get("www.google.com", TMPDIR+"/result");
+mgetl(file)
+file = http_get("www.google.com", TMPDIR+"/result.html", follow=%t);
+// then open the file in your browser
+
+result = http_get("http://jsonplaceholder.typicode.com/posts?userId=1")
+ ]]></programlisting>
+    </refsection>
+    <refsection role="see also">
+        <title>See also</title>
+        <simplelist type="inline">
+            <member>
+                <link linkend="http_post">http_post</link>
+            </member>
+            <member>
+                <link linkend="http_put">http_put</link>
+            </member>
+            <member>
+                <link linkend="http_patch">http_patch</link>
+            </member>
+            <member>
+                <link linkend="http_delete">http_delete</link>
+            </member>
+            <member>
+                <link linkend="http_upload">http_upload</link>
+            </member>
+            <member>
+                <link linkend="toJSON">toJSON</link>
+            </member>
+            <member>
+                <link linkend="fromJSON">fromJSON</link>
+            </member>
+        </simplelist>
+    </refsection>
+    <refsection>
+        <title>History</title>
+        <revhistory>
+            <revision>
+                <revnumber>6.1</revnumber>
+                <revremark>
+                    Function introduced.
+                </revremark>
+            </revision>
+        </revhistory>
+    </refsection>
+</refentry>
diff --git a/scilab/modules/webtools/help/en_US/http_patch.xml b/scilab/modules/webtools/help/en_US/http_patch.xml
new file mode 100644 (file)
index 0000000..ff342d7
--- /dev/null
@@ -0,0 +1,172 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2017 - ESI-Group
+ *
+ * This file is hereby licensed under the terms of the GNU GPL v2.0,
+ * pursuant to article 5.3.4 of the CeCILL v.2.1.
+ * This file was originally licensed under the terms of the CeCILL v2.1,
+ * and continues to be available under such terms.
+ * For more information, see the COPYING file which you should have received
+ * along with this program.
+ *
+ -->
+
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org"  xml:lang="en" xml:id="http_patch">
+    <refnamediv>
+        <refname>http_patch</refname>
+        <refpurpose>
+            HTTP PATCH request.
+        </refpurpose>
+    </refnamediv>
+    <refsynopsisdiv>
+        <title>Syntax</title>
+        <synopsis>
+            [result, status] = http_patch(url [,data, &lt;opt_args&gt;])
+        </synopsis>
+    </refsynopsisdiv>
+    <refsection>
+        <title>Arguments</title>
+        <variablelist>
+            <varlistentry>
+                <term>url</term>
+                <listitem>
+                    <para>
+                        A string containing the server adresse following by the optional port, the route of the request and query datas.
+                        syntax: "adresse:port/route?queryfield=querydata"
+                    </para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>data</term>
+                <listitem>
+                    <para>
+                        This argument represent data sent by the request.
+                        Can be a scilab variable wich will be converted
+                        into JSON format if possible or sent as a string.
+                    </para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>&lt;opt_args&gt;</term>
+                <listitem>
+                    <para>
+                        this represents a sequence of statements
+                        <literal>key1=value1, key2=value2, ...</literal>
+                        where <literal>key1</literal>,
+                        <literal>key2</literal>, ... can be one of the following:
+                    </para>
+                    <variablelist>
+                        <varlistentry>
+                            <term>cert</term>
+                            <listitem>
+                                <para>This option determines whether Scilab verifies the authenticity of the peer's certificate.
+                                    If <literal>none</literal> is given, no verification is performed.
+                                    <warning>
+                                        Disabling verification of the certificate allows bad guys to man-in-the-middle the communication without you knowing it.
+                                        Disabling verification makes the communication insecure.
+                                        Just having encryption on a transfer is not enough as you cannot be sure that you are communicating with the correct end-point.
+                                    </warning>
+                                </para>
+                            </listitem>
+                        </varlistentry>
+                        <varlistentry>
+                            <term>follow</term>
+                            <listitem>
+                                <para>
+                                    By default, <literal>follow</literal> is false. Set <literal>follow=%t</literal> to follow eventual redirections.
+                                </para>
+                            </listitem>
+                        </varlistentry>
+                        <varlistentry>
+                            <term>auth</term>
+                            <listitem>
+                                <para>Username and password can be specified for the websites which required authentication.</para>
+                                <para>
+                                    The syntax is <literal>auth="username:password"</literal>
+                                </para>
+                            </listitem>
+                        </varlistentry>
+                    </variablelist>
+                    <variablelist>
+                        <varlistentry>
+                            <term>format</term>
+                            <listitem>
+                                <para>
+                                    This option determines the format of data sent.
+                                    Only the JSON format is supported. Value can be "json" or "JSON".
+                                </para>
+                            </listitem>
+                        </varlistentry>
+                    </variablelist>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>result</term>
+                <listitem>
+                    <para>
+                        Result is a string wich contain the server answer or
+                        a scilab variable if the answer is in JSON format.
+                    </para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>status</term>
+                <listitem>
+                    <para>
+                        HTTP response code.
+                    </para>
+                </listitem>
+            </varlistentry>
+        </variablelist>
+    </refsection>
+    <refsection>
+        <title>Description</title>
+        <para>This function will perform an HTTP PATCH request.</para>
+        <para>The proxy configuration is used if it's enabled in the Preferences under the rubric "Internet".</para>
+    </refsection>
+    <refsection>
+        <title>Examples</title>
+        <programlisting role="example"><![CDATA[
+data.title = "New title";
+result = http_patch("http://jsonplaceholder.typicode.com/posts/1", data)
+ ]]></programlisting>
+    </refsection>
+    <refsection role="see also">
+        <title>See also</title>
+        <simplelist type="inline">
+            <member>
+                <link linkend="http_get">http_get</link>
+            </member>
+            <member>
+                <link linkend="http_put">http_put</link>
+            </member>
+            <member>
+                <link linkend="http_post">http_post</link>
+            </member>
+            <member>
+                <link linkend="http_delete">http_delete</link>
+            </member>
+            <member>
+                <link linkend="http_upload">http_upload</link>
+            </member>
+            <member>
+                <link linkend="toJSON">toJSON</link>
+            </member>
+            <member>
+                <link linkend="fromJSON">fromJSON</link>
+            </member>
+        </simplelist>
+    </refsection>
+    <refsection>
+        <title>History</title>
+        <revhistory>
+            <revision>
+                <revnumber>6.1</revnumber>
+                <revremark>
+                    Function introduced.
+                </revremark>
+            </revision>
+        </revhistory>
+    </refsection>
+</refentry>
diff --git a/scilab/modules/webtools/help/en_US/http_post.xml b/scilab/modules/webtools/help/en_US/http_post.xml
new file mode 100644 (file)
index 0000000..5613022
--- /dev/null
@@ -0,0 +1,174 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2017 - ESI-Group
+ *
+ * This file is hereby licensed under the terms of the GNU GPL v2.0,
+ * pursuant to article 5.3.4 of the CeCILL v.2.1.
+ * This file was originally licensed under the terms of the CeCILL v2.1,
+ * and continues to be available under such terms.
+ * For more information, see the COPYING file which you should have received
+ * along with this program.
+ *
+ -->
+
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org"  xml:lang="en" xml:id="http_post">
+    <refnamediv>
+        <refname>http_post</refname>
+        <refpurpose>
+            HTTP POST request.
+        </refpurpose>
+    </refnamediv>
+    <refsynopsisdiv>
+        <title>Syntax</title>
+        <synopsis>
+            [result, status] = http_post(url [,data, &lt;opt_args&gt;])
+        </synopsis>
+    </refsynopsisdiv>
+    <refsection>
+        <title>Arguments</title>
+        <variablelist>
+            <varlistentry>
+                <term>url</term>
+                <listitem>
+                    <para>
+                        A string containing the server adresse following by the optional port, the route of the request and query datas.
+                        syntax: "adresse:port/route?queryfield=querydata"
+                    </para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>data</term>
+                <listitem>
+                    <para>
+                        This argument represent data sent by the request.
+                        Can be a scilab variable wich will be converted
+                        into JSON format if possible or sent as a string.
+                    </para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>&lt;opt_args&gt;</term>
+                <listitem>
+                    <para>
+                        This represents a sequence of statements
+                        <literal>key1=value1, key2=value2, ...</literal>
+                        where <literal>key1</literal>,
+                        <literal>key2</literal>, ... can be one of the following:
+                    </para>
+                    <variablelist>
+                        <varlistentry>
+                            <term>cert</term>
+                            <listitem>
+                                <para>This option determines whether Scilab verifies the authenticity of the peer's certificate.
+                                    If <literal>none</literal> is given, no verification is performed.
+                                    <warning>
+                                        Disabling verification of the certificate allows bad guys to man-in-the-middle the communication without you knowing it.
+                                        Disabling verification makes the communication insecure.
+                                        Just having encryption on a transfer is not enough as you cannot be sure that you are communicating with the correct end-point.
+                                    </warning>
+                                </para>
+                            </listitem>
+                        </varlistentry>
+                        <varlistentry>
+                            <term>follow</term>
+                            <listitem>
+                                <para>
+                                    By default, <literal>follow</literal> is false. Set <literal>follow=%t</literal> to follow eventual redirections.
+                                </para>
+                            </listitem>
+                        </varlistentry>
+                        <varlistentry>
+                            <term>auth</term>
+                            <listitem>
+                                <para>Username and password can be specified for the websites which required authentication.</para>
+                                <para>
+                                    The syntax is <literal>auth="username:password"</literal>
+                                </para>
+                            </listitem>
+                        </varlistentry>
+                    </variablelist>
+                    <variablelist>
+                        <varlistentry>
+                            <term>format</term>
+                            <listitem>
+                                <para>
+                                    This option determines the format of data sent.
+                                    Only the JSON format is supported. Value can be "json" or "JSON".
+                                </para>
+                            </listitem>
+                        </varlistentry>
+                    </variablelist>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>result</term>
+                <listitem>
+                    <para>
+                        Result is a string wich contain the server answer or
+                        a scilab variable if the answer is in JSON format.
+                    </para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>status</term>
+                <listitem>
+                    <para>
+                        HTTP response code.
+                    </para>
+                </listitem>
+            </varlistentry>
+        </variablelist>
+    </refsection>
+    <refsection>
+        <title>Description</title>
+        <para>This function will perform an HTTP POST request.</para>
+        <para>The proxy configuration is used if it's enabled in the Preferences under the rubric "Internet".</para>
+    </refsection>
+    <refsection>
+        <title>Examples</title>
+        <programlisting role="example"><![CDATA[
+data.userId = 12;
+data.title  = "A title";
+data.body   = "A body";
+result = http_post("http://jsonplaceholder.typicode.com/posts", data)
+ ]]></programlisting>
+    </refsection>
+    <refsection role="see also">
+        <title>See also</title>
+        <simplelist type="inline">
+            <member>
+                <link linkend="http_get">http_get</link>
+            </member>
+            <member>
+                <link linkend="http_put">http_put</link>
+            </member>
+            <member>
+                <link linkend="http_patch">http_patch</link>
+            </member>
+            <member>
+                <link linkend="http_delete">http_delete</link>
+            </member>
+            <member>
+                <link linkend="http_upload">http_upload</link>
+            </member>
+            <member>
+                <link linkend="toJSON">toJSON</link>
+            </member>
+            <member>
+                <link linkend="fromJSON">fromJSON</link>
+            </member>
+        </simplelist>
+    </refsection>
+    <refsection>
+        <title>History</title>
+        <revhistory>
+            <revision>
+                <revnumber>6.1</revnumber>
+                <revremark>
+                    Function introduced.
+                </revremark>
+            </revision>
+        </revhistory>
+    </refsection>
+</refentry>
diff --git a/scilab/modules/webtools/help/en_US/http_put.xml b/scilab/modules/webtools/help/en_US/http_put.xml
new file mode 100644 (file)
index 0000000..c622ed0
--- /dev/null
@@ -0,0 +1,175 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2017 - ESI-Group
+ *
+ * This file is hereby licensed under the terms of the GNU GPL v2.0,
+ * pursuant to article 5.3.4 of the CeCILL v.2.1.
+ * This file was originally licensed under the terms of the CeCILL v2.1,
+ * and continues to be available under such terms.
+ * For more information, see the COPYING file which you should have received
+ * along with this program.
+ *
+ -->
+
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org"  xml:lang="en" xml:id="http_put">
+    <refnamediv>
+        <refname>http_put</refname>
+        <refpurpose>
+            HTTP PUT request.
+        </refpurpose>
+    </refnamediv>
+    <refsynopsisdiv>
+        <title>Syntax</title>
+        <synopsis>
+            [result, status] = http_put(url [,data, &lt;opt_args&gt;])
+        </synopsis>
+    </refsynopsisdiv>
+    <refsection>
+        <title>Arguments</title>
+        <variablelist>
+            <varlistentry>
+                <term>url</term>
+                <listitem>
+                    <para>
+                        A string containing the server adresse following by the optional port, the route of the request and query datas.
+                        syntax: "adresse:port/route?queryfield=querydata"
+                    </para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>data</term>
+                <listitem>
+                    <para>
+                        This argument represent data sent by the request.
+                        Can be a scilab variable wich will be converted
+                        into JSON format if possible or sent as a string.
+                    </para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>&lt;opt_args&gt;</term>
+                <listitem>
+                    <para>
+                        This represents a sequence of statements
+                        <literal>key1=value1, key2=value2, ...</literal>
+                        where <literal>key1</literal>,
+                        <literal>key2</literal>, ... can be one of the following:
+                    </para>
+                    <variablelist>
+                        <varlistentry>
+                            <term>cert</term>
+                            <listitem>
+                                <para>This option determines whether Scilab verifies the authenticity of the peer's certificate.
+                                    If <literal>none</literal> is given, no verification is performed.
+                                    <warning>
+                                        Disabling verification of the certificate allows bad guys to man-in-the-middle the communication without you knowing it.
+                                        Disabling verification makes the communication insecure.
+                                        Just having encryption on a transfer is not enough as you cannot be sure that you are communicating with the correct end-point.
+                                    </warning>
+                                </para>
+                            </listitem>
+                        </varlistentry>
+                        <varlistentry>
+                            <term>follow</term>
+                            <listitem>
+                                <para>
+                                    By default, <literal>follow</literal> is false. Set <literal>follow=%t</literal> to follow eventual redirections.
+                                </para>
+                            </listitem>
+                        </varlistentry>
+                        <varlistentry>
+                            <term>auth</term>
+                            <listitem>
+                                <para>Username and password can be specified for the websites which required authentication.</para>
+                                <para>
+                                    The syntax is <literal>auth="username:password"</literal>
+                                </para>
+                            </listitem>
+                        </varlistentry>
+                    </variablelist>
+                    <variablelist>
+                        <varlistentry>
+                            <term>format</term>
+                            <listitem>
+                                <para>
+                                    This option determines the format of data sent.
+                                    Only the JSON format is supported. Value can be "json" or "JSON".
+                                </para>
+                            </listitem>
+                        </varlistentry>
+                    </variablelist>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>result</term>
+                <listitem>
+                    <para>
+                        Result is a string wich contain the server answer or
+                        a scilab variable if the answer is in JSON format.
+                    </para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>status</term>
+                <listitem>
+                    <para>
+                        HTTP response code.
+                    </para>
+                </listitem>
+            </varlistentry>
+        </variablelist>
+    </refsection>
+    <refsection>
+        <title>Description</title>
+        <para>This function will perform an HTTP PUT request.</para>
+        <para>The proxy configuration is used if it's enabled in the Preferences under the rubric "Internet".</para>
+    </refsection>
+    <refsection>
+        <title>Examples</title>
+        <programlisting role="example"><![CDATA[
+data.userId = 12;
+data.title  = "A title";
+data.body   = "A body";
+data.id = 1;
+result = http_put(http://jsonplaceholder.typicode.com/posts/1", data)
+ ]]></programlisting>
+    </refsection>
+    <refsection role="see also">
+        <title>See also</title>
+        <simplelist type="inline">
+            <member>
+                <link linkend="http_get">http_get</link>
+            </member>
+            <member>
+                <link linkend="http_post">http_put</link>
+            </member>
+            <member>
+                <link linkend="http_patch">http_patch</link>
+            </member>
+            <member>
+                <link linkend="http_delete">http_delete</link>
+            </member>
+            <member>
+                <link linkend="http_upload">http_upload</link>
+            </member>
+            <member>
+                <link linkend="toJSON">toJSON</link>
+            </member>
+            <member>
+                <link linkend="fromJSON">fromJSON</link>
+            </member>
+        </simplelist>
+    </refsection>
+    <refsection>
+        <title>History</title>
+        <revhistory>
+            <revision>
+                <revnumber>6.1</revnumber>
+                <revremark>
+                    Function introduced.
+                </revremark>
+            </revision>
+        </revhistory>
+    </refsection>
+</refentry>
diff --git a/scilab/modules/webtools/help/en_US/http_upload.xml b/scilab/modules/webtools/help/en_US/http_upload.xml
new file mode 100644 (file)
index 0000000..3dfcc27
--- /dev/null
@@ -0,0 +1,197 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2017 - ESI-Group
+ *
+ * This file is hereby licensed under the terms of the GNU GPL v2.0,
+ * pursuant to article 5.3.4 of the CeCILL v.2.1.
+ * This file was originally licensed under the terms of the CeCILL v2.1,
+ * and continues to be available under such terms.
+ * For more information, see the COPYING file which you should have received
+ * along with this program.
+ *
+ -->
+
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org"  xml:lang="en" xml:id="http_upload">
+    <refnamediv>
+        <refname>http_post</refname>
+        <refpurpose>
+            HTTP POST or PUT request to upload file(s) on server.
+        </refpurpose>
+    </refnamediv>
+    <refsynopsisdiv>
+        <title>Syntax</title>
+        <synopsis>
+            [result, status] = http_upload(url, filename, variablename [,data, &lt;opt_args&gt;])
+        </synopsis>
+    </refsynopsisdiv>
+    <refsection>
+        <title>Arguments</title>
+        <variablelist>
+            <varlistentry>
+                <term>url</term>
+                <listitem>
+                    <para>
+                        A string containing the server adresse following by the optional port, the route of the request and query datas.
+                        syntax: "adresse:port/route?queryfield=querydata"
+                    </para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>filename</term>
+                <listitem>
+                    <para>
+                        A string or a matrix of string which contains file(s) to upload on server.
+                    </para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>variablename</term>
+                <listitem>
+                    <para>
+                        A string wich contains the file variable name expected by the server.
+                        This value must be given by the documentation of the API you are using.
+                    </para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>data</term>
+                <listitem>
+                    <para>
+                        This argument represent data sent by the request.
+                        Can be a scilab variable wich will be converted
+                        into JSON format if possible or sent as a string.
+                    </para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>&lt;opt_args&gt;</term>
+                <listitem>
+                    <para>
+                        This represents a sequence of statements
+                        <literal>key1=value1, key2=value2, ...</literal>
+                        where <literal>key1</literal>,
+                        <literal>key2</literal>, ... can be one of the following:
+                    </para>
+                    <variablelist>
+                        <varlistentry>
+                            <term>cert</term>
+                            <listitem>
+                                <para>This option determines whether Scilab verifies the authenticity of the peer's certificate.
+                                    If <literal>none</literal> is given, no verification is performed.
+                                    <warning>
+                                        Disabling verification of the certificate allows bad guys to man-in-the-middle the communication without you knowing it.
+                                        Disabling verification makes the communication insecure.
+                                        Just having encryption on a transfer is not enough as you cannot be sure that you are communicating with the correct end-point.
+                                    </warning>
+                                </para>
+                            </listitem>
+                        </varlistentry>
+                        <varlistentry>
+                            <term>follow</term>
+                            <listitem>
+                                <para>
+                                    By default, <literal>follow</literal> is false. Set <literal>follow=%t</literal> to follow eventual redirections.
+                                </para>
+                            </listitem>
+                        </varlistentry>
+                        <varlistentry>
+                            <term>auth</term>
+                            <listitem>
+                                <para>Username and password can be specified for the websites which required authentication.</para>
+                                <para>
+                                    The syntax is <literal>auth="username:password"</literal>
+                                </para>
+                            </listitem>
+                        </varlistentry>
+                    </variablelist>
+                    <variablelist>
+                        <varlistentry>
+                            <term>method</term>
+                            <listitem>
+                                <para>
+                                    By default, this function send request a POST request.
+                                    Using this argument it is possible to use a PUT request, by passing method="PUT".
+                                </para>
+                            </listitem>
+                        </varlistentry>
+                    </variablelist>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>result</term>
+                <listitem>
+                    <para>
+                        Result is a string wich contain the server answer or
+                        a scilab variable if the answer is in JSON format.
+                    </para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>status</term>
+                <listitem>
+                    <para>
+                        HTTP response code.
+                    </para>
+                </listitem>
+            </varlistentry>
+        </variablelist>
+    </refsection>
+    <refsection>
+        <title>Description</title>
+        <para>This function will perform an HTTP POST or PUT request to upload file(s).</para>
+        <para>The proxy configuration is used if it's enabled in the Preferences under the rubric "Internet".</para>
+    </refsection>
+    <refsection>
+        <title>Examples</title>
+        <programlisting role="example"><![CDATA[
+f1 = "myfilename";
+res = http_upload("url:port/route", f1, "varname");
+res = http_upload("url:port/route", f1, "varname", method="PUT");
+
+f2 = "myfilenametwo";
+res = http_upload("url:port/route", [f1 f2], "varname");
+
+data.type = "images"
+data.date = date();
+res = http_upload("url:port/route", [f1 f2], data, "varname");
+ ]]></programlisting>
+    </refsection>
+    <refsection role="see also">
+        <title>See also</title>
+        <simplelist type="inline">
+            <member>
+                <link linkend="http_get">http_get</link>
+            </member>
+            <member>
+                <link linkend="http_put">http_put</link>
+            </member>
+            <member>
+                <link linkend="http_patch">http_patch</link>
+            </member>
+            <member>
+                <link linkend="http_delete">http_delete</link>
+            </member>
+            <member>
+                <link linkend="http_upload">http_upload</link>
+            </member>
+            <member>
+                <link linkend="toJSON">toJSON</link>
+            </member>
+            <member>
+                <link linkend="fromJSON">fromJSON</link>
+            </member>
+        </simplelist>
+    </refsection>
+    <refsection>
+        <title>History</title>
+        <revhistory>
+            <revision>
+                <revnumber>6.1</revnumber>
+                <revremark>
+                    Function introduced.
+                </revremark>
+            </revision>
+        </revhistory>
+    </refsection>
+</refentry>
diff --git a/scilab/modules/webtools/help/en_US/toJSON.xml b/scilab/modules/webtools/help/en_US/toJSON.xml
new file mode 100644 (file)
index 0000000..82ef756
--- /dev/null
@@ -0,0 +1,119 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2017 - ESI-Group
+ *
+ * This file is hereby licensed under the terms of the GNU GPL v2.0,
+ * pursuant to article 5.3.4 of the CeCILL v.2.1.
+ * This file was originally licensed under the terms of the CeCILL v2.1,
+ * and continues to be available under such terms.
+ * For more information, see the COPYING file which you should have received
+ * along with this program.
+ *
+ -->
+
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org"  xml:lang="en" xml:id="toJSON">
+    <refnamediv>
+        <refname>toJSON</refname>
+        <refpurpose>
+            Convert scilab variable to JSON.
+        </refpurpose>
+    </refnamediv>
+    <refsynopsisdiv>
+        <title>Syntax</title>
+        <synopsis>
+            result = toJSON(var [,filename, indent])
+        </synopsis>
+    </refsynopsisdiv>
+    <refsection>
+        <title>Arguments</title>
+        <variablelist>
+            <varlistentry>
+                <term>var</term>
+                <listitem>
+                    <para>
+                        The Scilab variable to convert in JSON format.
+                    </para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>filename</term>
+                <listitem>
+                    <para>
+                        If a file name is given, the convertion is writen in this file.
+                    </para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>indent</term>
+                <listitem>
+                    <para>
+                        If this argument is given, the result is indented. The value is the size of TAB.
+                    </para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>result</term>
+                <listitem>
+                    <para>
+                        Result is a string wich contain the data converted to JSON.
+                        If a filename is given, no result is returned.
+                    </para>
+                </listitem>
+            </varlistentry>
+        </variablelist>
+    </refsection>
+    <refsection>
+        <title>Description</title>
+        <para>
+            This function convert a Scilab variable into a string or JSON files.
+        </para>
+    </refsection>
+    <refsection>
+        <title>Examples</title>
+        <programlisting role="example"><![CDATA[
+st = struct("status", "OK", "value", 12);
+toJSON(st)
+toJSON([1, 2, 3])
+st = struct("test", ["a" "b"], "values", [1 2]);
+toJSON(st, 4)
+ ]]></programlisting>
+    </refsection>
+    <refsection role="see also">
+        <title>See also</title>
+        <simplelist type="inline">
+            <member>
+                <link linkend="http_post">http_post</link>
+            </member>
+            <member>
+                <link linkend="http_put">http_put</link>
+            </member>
+            <member>
+                <link linkend="http_patch">http_patch</link>
+            </member>
+            <member>
+                <link linkend="http_delete">http_delete</link>
+            </member>
+            <member>
+                <link linkend="http_upload">http_upload</link>
+            </member>
+            <member>
+                <link linkend="fromJSON">fromJSON</link>
+            </member>
+            <member>
+                <link linkend="http_get">http_get</link>
+            </member>
+        </simplelist>
+    </refsection>
+    <refsection>
+        <title>History</title>
+        <revhistory>
+            <revision>
+                <revnumber>6.1</revnumber>
+                <revremark>
+                    Function introduced.
+                </revremark>
+            </revision>
+        </revhistory>
+    </refsection>
+</refentry>
diff --git a/scilab/modules/webtools/help/fr_FR/addchapter.sce b/scilab/modules/webtools/help/fr_FR/addchapter.sce
new file mode 100644 (file)
index 0000000..d90971f
--- /dev/null
@@ -0,0 +1,13 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2009 - DIGITEO
+//
+// Copyright (C) 2012 - 2016 - Scilab Enterprises
+//
+// This file is hereby licensed under the terms of the GNU GPL v2.0,
+// pursuant to article 5.3.4 of the CeCILL v.2.1.
+// This file was originally licensed under the terms of the CeCILL v2.1,
+// and continues to be available under such terms.
+// For more information, see the COPYING file which you should have received
+// along with this program.
+
+add_help_chapter("Web Tools",SCI+"/modules/webtools/help/fr_FR",%T);
diff --git a/scilab/modules/webtools/help/ja_JP/addchapter.sce b/scilab/modules/webtools/help/ja_JP/addchapter.sce
new file mode 100644 (file)
index 0000000..bc38fbb
--- /dev/null
@@ -0,0 +1,13 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2009 - DIGITEO
+//
+// Copyright (C) 2012 - 2016 - Scilab Enterprises
+//
+// This file is hereby licensed under the terms of the GNU GPL v2.0,
+// pursuant to article 5.3.4 of the CeCILL v.2.1.
+// This file was originally licensed under the terms of the CeCILL v2.1,
+// and continues to be available under such terms.
+// For more information, see the COPYING file which you should have received
+// along with this program.
+
+add_help_chapter("Web Tools",SCI+"/modules/webtools/help/ja_JP",%T);
diff --git a/scilab/modules/webtools/help/pt_BR/addchapter.sce b/scilab/modules/webtools/help/pt_BR/addchapter.sce
new file mode 100644 (file)
index 0000000..9a8da08
--- /dev/null
@@ -0,0 +1,13 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2009 - DIGITEO
+//
+// Copyright (C) 2012 - 2016 - Scilab Enterprises
+//
+// This file is hereby licensed under the terms of the GNU GPL v2.0,
+// pursuant to article 5.3.4 of the CeCILL v.2.1.
+// This file was originally licensed under the terms of the CeCILL v2.1,
+// and continues to be available under such terms.
+// For more information, see the COPYING file which you should have received
+// along with this program.
+
+add_help_chapter("Web Tools",SCI+"/modules/webtools/help/pt_BR",%T);
diff --git a/scilab/modules/webtools/help/ru_RU/addchapter.sce b/scilab/modules/webtools/help/ru_RU/addchapter.sce
new file mode 100644 (file)
index 0000000..09618d2
--- /dev/null
@@ -0,0 +1,13 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2009 - DIGITEO
+//
+// Copyright (C) 2012 - 2016 - Scilab Enterprises
+//
+// This file is hereby licensed under the terms of the GNU GPL v2.0,
+// pursuant to article 5.3.4 of the CeCILL v.2.1.
+// This file was originally licensed under the terms of the CeCILL v2.1,
+// and continues to be available under such terms.
+// For more information, see the COPYING file which you should have received
+// along with this program.
+
+add_help_chapter("Web Tools",SCI+"/modules/webtools/help/ru_RU",%T);
diff --git a/scilab/modules/webtools/includes/dynlib_webtools.h b/scilab/modules/webtools/includes/dynlib_webtools.h
new file mode 100644 (file)
index 0000000..45e69cc
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+*
+* Copyright (C) 2017 - ESI-Group
+*
+* This file is hereby licensed under the terms of the GNU GPL v2.0,
+* pursuant to article 5.3.4 of the CeCILL v.2.1.
+* This file was originally licensed under the terms of the CeCILL v2.1,
+* and continues to be available under such terms.
+* For more information, see the COPYING file which you should have received
+* along with this program.
+*
+*/
+
+/*--------------------------------------------------------------------------*/
+#ifndef __DYNLIB_WEBTOOLS_H__
+#define __DYNLIB_WEBTOOLS_H__
+
+#ifdef _MSC_VER
+#ifdef WEBTOOLS_EXPORTS
+#define WEBTOOLS_IMPEXP __declspec(dllexport)
+#else
+#define WEBTOOLS_IMPEXP __declspec(dllimport)
+#endif
+#else
+#define WEBTOOLS_IMPEXP
+#endif
+
+#endif /* __DYNLIB_WEBTOOLS_H__ */
+/*--------------------------------------------------------------------------*/
diff --git a/scilab/modules/webtools/includes/gw_webtools.h b/scilab/modules/webtools/includes/gw_webtools.h
new file mode 100644 (file)
index 0000000..82b87dd
--- /dev/null
@@ -0,0 +1,10 @@
+#ifndef __GW_WEBTOOLS_H__
+#define __GW_WEBTOOLS_H__
+
+#include "c_gateway_prototype.h"
+#include "dynlib_webtools.h"
+
+WEBTOOLS_IMPEXP C_GATEWAY_PROTOTYPE(sci_toJSON);
+WEBTOOLS_IMPEXP C_GATEWAY_PROTOTYPE(sci_fromJSON);
+
+#endif /* !__GW_WEBTOOLS_H__ */
diff --git a/scilab/modules/webtools/includes/webtools.h b/scilab/modules/webtools/includes/webtools.h
new file mode 100644 (file)
index 0000000..d9b201e
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+*
+* Copyright (C) 2017 - ESI-Group
+*
+* This file is hereby licensed under the terms of the GNU GPL v2.0,
+* pursuant to article 5.3.4 of the CeCILL v.2.1.
+* This file was originally licensed under the terms of the CeCILL v2.1,
+* and continues to be available under such terms.
+* For more information, see the COPYING file which you should have received
+* along with this program.
+*
+*/
+
+/*--------------------------------------------------------------------------*/
+#ifndef __WEBTOOLS_H__
+#define __WEBTOOLS_H__
+
+#include "dynlib_webtools.h"
+
+WEBTOOLS_IMPEXP int Initialize_Webtools(void);
+WEBTOOLS_IMPEXP int Finalize_Webtools(void);
+
+#endif /* __WEBTOOLS_H__ */
+/*--------------------------------------------------------------------------*/
diff --git a/scilab/modules/webtools/includes/webtools_gw.hxx b/scilab/modules/webtools/includes/webtools_gw.hxx
new file mode 100644 (file)
index 0000000..f5138de
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ *  Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ *
+ * Copyright (C) 2012 - 2016 - Scilab Enterprises
+ *  Copyright (C) 2017 - ESI-Group - Cedric DELAMARRE
+ *
+ * This file is hereby licensed under the terms of the GNU GPL v2.0,
+ * pursuant to article 5.3.4 of the CeCILL v.2.1.
+ * This file was originally licensed under the terms of the CeCILL v2.1,
+ * and continues to be available under such terms.
+ * For more information, see the COPYING file which you should have received
+ * along with this program.
+ *
+ */
+
+#ifndef __WEBTOOLS_GW_HXX__
+#define __WEBTOOLS_GW_HXX__
+
+#include "cpp_gateway_prototype.hxx"
+#include "function.hxx"
+
+extern "C"
+{
+#include "dynlib_webtools.h"
+}
+
+CPP_OPT_GATEWAY_PROTOTYPE_EXPORT(sci_http_get, WEBTOOLS_IMPEXP);
+CPP_OPT_GATEWAY_PROTOTYPE_EXPORT(sci_http_post, WEBTOOLS_IMPEXP);
+CPP_OPT_GATEWAY_PROTOTYPE_EXPORT(sci_http_put, WEBTOOLS_IMPEXP);
+CPP_OPT_GATEWAY_PROTOTYPE_EXPORT(sci_http_patch, WEBTOOLS_IMPEXP);
+CPP_OPT_GATEWAY_PROTOTYPE_EXPORT(sci_http_delete, WEBTOOLS_IMPEXP);
+CPP_OPT_GATEWAY_PROTOTYPE_EXPORT(sci_http_upload, WEBTOOLS_IMPEXP);
+
+types::Function::ReturnValue sci_http_put_post(types::typed_list &in, types::optional_list &opt, int _iRetCount, types::typed_list &out, const char* fname);
+int checkCommonOpt(void* curl, types::optional_list &opt, const char* fname);
+
+#endif /* !__WEBTOOLS_GW_HXX__ */
diff --git a/scilab/modules/webtools/license.txt b/scilab/modules/webtools/license.txt
new file mode 100644 (file)
index 0000000..e6ddcd8
--- /dev/null
@@ -0,0 +1,15 @@
+Copyright:
+Copyright (c) 2017 - ESI Group
+
+License:
+Copyright (C) 2017 - ESI Group
+
+This module is hereby licensed under the terms of the GNU GPL v2.0,
+pursuant to article 5.3.4 of the CeCILL v.2.1.
+This module was originally licensed under the terms of the CeCILL v2.1,
+and continues to be available under such terms.
+For more information, see the COPYING file which you should have received
+along with this program.
+
+Parts of this module is distributed under MIT license.
+https://github.com/zserge/jsmn
diff --git a/scilab/modules/webtools/macros/buildmacros.bat b/scilab/modules/webtools/macros/buildmacros.bat
new file mode 100644 (file)
index 0000000..a4b508e
--- /dev/null
@@ -0,0 +1,7 @@
+rem Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+rem Copyright (C) 2007 - INRIA - Allan CORNET
+rem Copyright (C) 2017 - ESI-Group - Cedric Delamarre
+rem 
+rem This file is distributed under the same license as the Scilab package.
+
+@..\..\..\bin\scilex -nwni -ns -e exec('buildmacros.sce');quit;
diff --git a/scilab/modules/webtools/macros/buildmacros.sce b/scilab/modules/webtools/macros/buildmacros.sce
new file mode 100644 (file)
index 0000000..1638635
--- /dev/null
@@ -0,0 +1,20 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2005 - INRIA - Allan CORNET
+//
+// Copyright (C) 2012 - 2016 - Scilab Enterprises
+// Copyright (C) 2017 - ESI-Group
+//
+// This file is hereby licensed under the terms of the GNU GPL v2.0,
+// pursuant to article 5.3.4 of the CeCILL v.2.1.
+// This file was originally licensed under the terms of the CeCILL v2.1,
+// and continues to be available under such terms.
+// For more information, see the COPYING file which you should have received
+// along with this program.
+
+//------------------------------------
+if (isdef("genlib") == %f) then
+    exec(SCI+"/modules/functions/scripts/buildmacros/loadgenlib.sce");
+end
+//------------------------------------
+genlib("webtoolslib","SCI/modules/webtools/macros",%f,%t);
+//------------------------------------
diff --git a/scilab/modules/webtools/macros/cleanmacros.bat b/scilab/modules/webtools/macros/cleanmacros.bat
new file mode 100644 (file)
index 0000000..5ee77a7
--- /dev/null
@@ -0,0 +1,9 @@
+rem Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+rem Copyright (C) 2007 - INRIA - Allan CORNET
+rem Copyright (C) 2017 - ESI-Group - Cedric Delamarre
+rem 
+rem This file is distributed under the same license as the Scilab package.
+
+@del *.bin 2>NUL
+@del lib 2>NUL
+@del names 2>NUL
diff --git a/scilab/modules/webtools/sci_gateway/cpp/checkCommonOpt.cpp b/scilab/modules/webtools/sci_gateway/cpp/checkCommonOpt.cpp
new file mode 100644 (file)
index 0000000..9312de3
--- /dev/null
@@ -0,0 +1,85 @@
+/*
+* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+* Copyright (C) 2017 - ESI-Group - Cedric DELAMARRE
+*
+* This file is hereby licensed under the terms of the GNU GPL v2.0,
+* pursuant to article 5.3.4 of the CeCILL v.2.1.
+* This file was originally licensed under the terms of the CeCILL v2.1,
+* and continues to be available under such terms.
+* For more information, see the COPYING file which you should have received
+* along with this program.
+*
+*/
+/*--------------------------------------------------------------------------*/
+
+#include <curl/curl.h>
+#include "webtools_gw.hxx"
+#include "function.hxx"
+#include "string.hxx"
+#include "sciCurl.hxx"
+
+extern "C"
+{
+#include "localization.h"
+#include "Scierror.h"
+#include "sci_malloc.h"
+}
+
+/*--------------------------------------------------------------------------*/
+int checkCommonOpt(void* _curl, types::optional_list &opt, const char* fname)
+{
+    CURL* curl = (CURL*)_curl;
+
+    // get optional argument if necessary
+    for (const auto& o : opt)
+    {
+        if (o.first == L"cert")
+        {
+            if(o.second->isString() == false || o.second->getAs<types::String>()->isScalar() == false)
+            {
+                Scierror(999, _("%s: Wrong type for input argument #%s: A scalar string expected.\n"), fname, o.first.data());
+                return 1;
+            }
+
+            wchar_t* pCert = o.second->getAs<types::String>()->get(0);
+            if(wcscmp(pCert, L"none") == 0)
+            {
+                curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, false);
+                return 0;
+            }
+            // TODO management of cert file
+            // else if cert is file
+
+            Scierror(999, _("%s: Wrong value for input argument #%s: 'none' expected.\n"), fname, o.first.data());
+            return 1;
+        }
+        else if(o.first == L"follow")
+        {
+            if(o.second->isBool() == false || o.second->getAs<types::Bool>()->isScalar() == false)
+            {
+                Scierror(999, _("%s: Wrong type for input argument #%s: A scalar boolean expected.\n"), fname, o.first.data());
+                return 1;
+            }
+
+            if(o.second->getAs<types::Bool>()->get(0) == 1)
+            {
+                curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1);
+            }
+        }
+        else if(o.first == L"auth")
+        {
+            if(o.second->isString() == false || o.second->getAs<types::String>()->isScalar() == false)
+            {
+                Scierror(999, _("%s: Wrong type for input argument #%s: A scalar string expected.\n"), fname, o.first.data());
+                return 1;
+            }
+
+            char* pAuth = wide_string_to_UTF8(o.second->getAs<types::String>()->get(0));
+            curl_easy_setopt(curl, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
+            curl_easy_setopt(curl, CURLOPT_USERPWD, pAuth);
+            FREE(pAuth);
+        }
+    }
+
+    return 0;
+}
diff --git a/scilab/modules/webtools/sci_gateway/cpp/sci_fromJSON.cpp b/scilab/modules/webtools/sci_gateway/cpp/sci_fromJSON.cpp
new file mode 100644 (file)
index 0000000..555ffce
--- /dev/null
@@ -0,0 +1,148 @@
+/*
+* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+* Copyright (C) 2017 - ESI-Group - Antoine ELIAS
+*
+*
+* This file is hereby licensed under the terms of the GNU GPL v2.0,
+* pursuant to article 5.3.4 of the CeCILL v.2.1.
+* This file was originally licensed under the terms of the CeCILL v2.1,
+* and continues to be available under such terms.
+* For more information, see the COPYING file which you should have received
+* along with this program.
+*
+*/
+/*--------------------------------------------------------------------------*/
+
+#include <list>
+#include <vector>
+#include <unordered_map>
+#include <algorithm>
+#include <string>
+#include <fstream>
+#include <chrono>
+
+#define __API_SCILAB_UNSAFE__
+#include "json.hxx"
+
+//#define SHOW_TIMER
+
+extern "C"
+{
+#include "gw_webtools.h"
+#include "api_scilab.h"
+#include "Scierror.h"
+#include "sciprint.h"
+#include "sci_malloc.h"
+#include <localization.h>
+#include "charEncoding.h"
+}
+
+const std::string name("fromJSON");
+
+/* ==================================================================== */
+int sci_fromJSON(scilabEnv env, int nin, scilabVar *in, int nopt, scilabOpt opt, int nout, scilabVar *out)
+{
+    std::string json;
+#ifdef SHOW_TIMER
+    std::chrono::steady_clock::time_point ttotal = std::chrono::steady_clock::now();
+    std::chrono::steady_clock::time_point tinput = std::chrono::steady_clock::now();
+#endif
+
+    if (nin < 1 && nin > 2)
+    {
+        Scierror(999, _("%s: Wrong number of input arguments: %d to %d expected.\n"), name.data(), 1, 2);
+        return STATUS_ERROR;
+    }
+
+    if (nin == 2)
+    {
+        if (!scilab_isString(env, in[1]) || !scilab_isScalar(env, in[1]))
+        {
+            Scierror(999, _("%s: Wrong type for input argument #%d: string expected.\n"), name.data(), 2);
+            return STATUS_ERROR;
+        }
+
+        wchar_t *wf = nullptr;
+        scilab_getString(env, in[1], &wf);
+        if (wcscmp(wf, L"file") != 0)
+        {
+            Scierror(999, _("%s: Wrong value for input argument #%d: \"file\" expected.\n"), name.data(), 2);
+            return STATUS_ERROR;
+        }
+
+        wchar_t* wfile = nullptr;
+        scilab_getString(env, in[0], &wfile);
+
+        char *_filename = wide_string_to_UTF8(wfile);
+        if (_filename == NULL)
+        {
+            return false;
+        }
+
+        std::ifstream infile(_filename);
+        FREE(_filename);
+
+        json.reserve(infile.tellg());
+        infile.seekg(0, std::ios::beg);
+
+        json.assign((std::istreambuf_iterator<char>(infile)),
+            std::istreambuf_iterator<char>());
+    }
+    else
+    {
+        //must be a string or string matrix
+        if (!scilab_isString(env, in[0]))
+        {
+            Scierror(999, _("%s: Wrong type for input argument #%d: string expected.\n"), name.data(), 1);
+            return STATUS_ERROR;
+        }
+
+        if (scilab_isScalar(env, in[0]))
+        {
+            wchar_t* w;
+            scilab_getString(env, in[0], &w);
+            char* s = wide_string_to_UTF8(w);
+            json = s;
+            FREE(s);
+        }
+        else
+        {
+            wchar_t** w;
+            int size = scilab_getSize(env, in[0]);
+            scilab_getStringArray(env, in[0], &w);
+
+            for (int i = 0; i < size; ++i)
+            {
+                char* s = wide_string_to_UTF8(w[i]);
+                json += s;
+                FREE(s);
+            }
+        }
+    }
+
+#ifdef SHOW_TIMER
+    std::chrono::steady_clock::time_point tinputend = std::chrono::steady_clock::now();
+    sciprint("Input\t: %d ms\n", std::chrono::duration_cast<std::chrono::milliseconds>(tinputend - tinput).count());
+
+    std::chrono::steady_clock::time_point tparse = std::chrono::steady_clock::now();
+#endif
+
+    scilabVar var = fromJSON(env, json);
+    if (var == nullptr)
+    {
+        Scierror(999, _("%s: JSON format expected.\n"), name.data(), 1);
+        return STATUS_ERROR;
+    }
+
+    out[0] = var;
+
+#ifdef SHOW_TIMER
+    std::chrono::steady_clock::time_point toutputend = std::chrono::steady_clock::now();
+    sciprint("Output\t: %d ms\n", std::chrono::duration_cast<std::chrono::milliseconds>(toutputend - toutput).count());
+
+    std::chrono::steady_clock::time_point ttotalend = std::chrono::steady_clock::now();
+    sciprint("Total\t: %d ms\n", std::chrono::duration_cast<std::chrono::milliseconds>(ttotalend - ttotal).count());
+#endif
+
+    return STATUS_OK;
+}
diff --git a/scilab/modules/webtools/sci_gateway/cpp/sci_http_delete.cpp b/scilab/modules/webtools/sci_gateway/cpp/sci_http_delete.cpp
new file mode 100644 (file)
index 0000000..83170f2
--- /dev/null
@@ -0,0 +1,102 @@
+/*
+* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+* Copyright (C) 2017 - ESI-Group - Cedric DELAMARRE
+*
+*
+* This file is hereby licensed under the terms of the GNU GPL v2.0,
+* pursuant to article 5.3.4 of the CeCILL v.2.1.
+* This file was originally licensed under the terms of the CeCILL v2.1,
+* and continues to be available under such terms.
+* For more information, see the COPYING file which you should have received
+* along with this program.
+*
+*/
+/*--------------------------------------------------------------------------*/
+
+#include <curl/curl.h>
+#include "webtools_gw.hxx"
+#include "function.hxx"
+#include "string.hxx"
+#include "double.hxx"
+#include "sciCurl.hxx"
+
+extern "C"
+{
+#include "localization.h"
+#include "Scierror.h"
+#include "sciprint.h"
+#include "sci_malloc.h"
+}
+/*--------------------------------------------------------------------------*/
+static const char fname[] = "http_delete";
+types::Function::ReturnValue sci_http_delete(types::typed_list &in, types::optional_list &opt, int _iRetCount, types::typed_list &out)
+{
+    SciCurl* sciCurlObj = SciCurl::getInstance();
+    CURLcode res = CURLE_OK;
+
+    if (in.size() != 1)
+    {
+        Scierror(77, _("%s: Wrong number of input argument(s): %d expected.\n"), fname, 1);
+        return types::Function::Error;
+    }
+
+    if (_iRetCount > 2)
+    {
+        Scierror(78, _("%s: Wrong number of output argument(s): %d to %d expected.\n"), fname, 1, 2);
+        return types::Function::Error;
+    }
+
+    // get URL
+    if(in[0]->isString() == false && in[0]->getAs<types::String>()->isScalar() == false)
+    {
+        Scierror(999, _("%s: Wrong type for input argument #%d: A scalar string expected.\n"), fname, 1);
+        return types::Function::Error;
+    }
+
+    CURL* curl = curl_easy_init();
+    if(curl == nullptr)
+    {
+        Scierror(999, _("%s: CURL initialization failed.\n"), fname);
+        return types::Function::Error;
+    }
+
+    char* pcURL = wide_string_to_UTF8(in[0]->getAs<types::String>()->get(0));
+    curl_easy_setopt(curl, CURLOPT_URL, pcURL);
+    FREE(pcURL);
+
+    // common optional argument
+    if(checkCommonOpt((void*)curl, opt, fname))
+    {
+        return types::Function::Error;
+    }
+
+    // set proxy information
+    if(sciCurlObj->setProxy(curl))
+    {
+        Scierror(999, _("%s: Wrong proxy information, please check in the 'internet' Scilab preference.\n"), fname);
+        return types::Function::Error;
+    }
+
+    curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "DELETE");
+    sciCurlObj->getResultAsObject(curl);
+
+    res = curl_easy_perform(curl);
+    if(res != CURLE_OK)
+    {
+        Scierror(999, _("%s: CURL execution failed.\n%s\n"), fname, curl_easy_strerror(res));
+        sciCurlObj->clear();
+        return types::Function::Error;
+    }
+
+    out.push_back(sciCurlObj->getResult());
+
+    if(_iRetCount == 2)
+    {
+        long http_code = 0;
+        curl_easy_getinfo (curl, CURLINFO_RESPONSE_CODE, &http_code);
+        out.push_back(new types::Double((double)http_code));
+    }
+
+    curl_easy_cleanup(curl);
+    return types::Function::OK;
+}
diff --git a/scilab/modules/webtools/sci_gateway/cpp/sci_http_get.cpp b/scilab/modules/webtools/sci_gateway/cpp/sci_http_get.cpp
new file mode 100644 (file)
index 0000000..5aff0e9
--- /dev/null
@@ -0,0 +1,146 @@
+/*
+* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+* Copyright (C) 2017 - ESI-Group - Cedric DELAMARRE
+*
+*
+* This file is hereby licensed under the terms of the GNU GPL v2.0,
+* pursuant to article 5.3.4 of the CeCILL v.2.1.
+* This file was originally licensed under the terms of the CeCILL v2.1,
+* and continues to be available under such terms.
+* For more information, see the COPYING file which you should have received
+* along with this program.
+*
+*/
+/*--------------------------------------------------------------------------*/
+
+#include <curl/curl.h>
+#include "webtools_gw.hxx"
+#include "function.hxx"
+#include "string.hxx"
+#include "double.hxx"
+#include "sciCurl.hxx"
+
+extern "C"
+{
+#include "localization.h"
+#include "Scierror.h"
+#include "sciprint.h"
+#include "sci_malloc.h"
+#include "getFullFilename.h"
+}
+/*--------------------------------------------------------------------------*/
+static const char fname[] = "http_get";
+types::Function::ReturnValue sci_http_get(types::typed_list &in, types::optional_list &opt, int _iRetCount, types::typed_list &out)
+{
+    SciCurl* sciCurlObj = SciCurl::getInstance();
+    CURLcode res = CURLE_OK;
+    FILE* fd = NULL;
+    types::InternalType* pOut = NULL;
+
+    if (in.size() < 1 || in.size() > 2)
+    {
+        Scierror(77, _("%s: Wrong number of input argument(s): %d to %d expected.\n"), fname, 1, 2);
+        return types::Function::Error;
+    }
+
+    if (_iRetCount > 2)
+    {
+        Scierror(78, _("%s: Wrong number of output argument(s): %d to %d expected.\n"), fname, 1, 2);
+        return types::Function::Error;
+    }
+
+    // get URL
+    if(in[0]->isString() == false || in[0]->getAs<types::String>()->isScalar() == false)
+    {
+        Scierror(999, _("%s: Wrong type for input argument #%d: A scalar string expected.\n"), fname, 1);
+        return types::Function::Error;
+    }
+
+    CURL* curl = curl_easy_init();
+    if(curl == nullptr)
+    {
+        Scierror(999, _("%s: CURL initialization failed.\n"), fname);
+        return types::Function::Error;
+    }
+
+    char* pcURL = wide_string_to_UTF8(in[0]->getAs<types::String>()->get(0));
+    curl_easy_setopt(curl, CURLOPT_URL, pcURL);
+    FREE(pcURL);
+
+    if(in.size() == 2)
+    {
+        // get output file name
+        if(in[1]->isString() == false || in[1]->getAs<types::String>()->isScalar() == false)
+        {
+            Scierror(999, _("%s: Wrong type for input argument #%d: A scalar string expected.\n"), fname, 2);
+            return types::Function::Error;
+        }
+
+        wchar_t* pwcFileName = getFullFilenameW(in[1]->getAs<types::String>()->get(0));
+        char* pcFileName = wide_string_to_UTF8(pwcFileName);
+
+        fd = fopen(pcFileName, "wb");
+        if(fd == NULL)
+        {
+            Scierror(999, _("%s: Wrong value for input argument #%d: The given path does not exists.\n"), fname, 2);
+            return types::Function::Error;
+        }
+
+        sciCurlObj->getResultAsFile(curl, fd);
+
+        pOut = new types::String(pwcFileName);
+        FREE(pcFileName);
+        FREE(pwcFileName);
+    }
+    else
+    {
+        sciCurlObj->getResultAsObject(curl);
+    }
+
+    // common optional argument
+    if(checkCommonOpt((void*)curl, opt, fname))
+    {
+        return types::Function::Error;
+    }
+
+    // set proxy information
+    if(sciCurlObj->setProxy(curl))
+    {
+        Scierror(999, _("%s: Wrong proxy information, please check in the 'internet' Scilab preference.\n"), fname);
+        return types::Function::Error;
+    }
+
+    res = curl_easy_perform(curl);
+    if(res != CURLE_OK)
+    {
+        Scierror(999, _("%s: CURL execution failed.\n%s\n"), fname, curl_easy_strerror(res));
+        sciCurlObj->clear();
+        if(fd)
+        {
+            fclose(fd);
+        }
+        return types::Function::Error;
+    }
+
+    if(in.size() == 2)
+    {
+        fclose(fd);
+        sciCurlObj->clear();
+    }
+    else
+    {
+        pOut = sciCurlObj->getResult();
+    }
+
+    out.push_back(pOut);
+
+    if(_iRetCount == 2)
+    {
+        long http_code = 0;
+        curl_easy_getinfo (curl, CURLINFO_RESPONSE_CODE, &http_code);
+        out.push_back(new types::Double((double)http_code));
+    }
+
+    curl_easy_cleanup(curl);
+    return types::Function::OK;
+}
diff --git a/scilab/modules/webtools/sci_gateway/cpp/sci_http_patch.cpp b/scilab/modules/webtools/sci_gateway/cpp/sci_http_patch.cpp
new file mode 100644 (file)
index 0000000..5dbab3b
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+* Copyright (C) 2017 - ESI-Group - Cedric DELAMARRE
+*
+*
+* This file is hereby licensed under the terms of the GNU GPL v2.0,
+* pursuant to article 5.3.4 of the CeCILL v.2.1.
+* This file was originally licensed under the terms of the CeCILL v2.1,
+* and continues to be available under such terms.
+* For more information, see the COPYING file which you should have received
+* along with this program.
+*
+*/
+/*--------------------------------------------------------------------------*/
+
+#include "webtools_gw.hxx"
+#include "function.hxx"
+
+/*--------------------------------------------------------------------------*/
+types::Function::ReturnValue sci_http_patch(types::typed_list &in, types::optional_list &opt, int _iRetCount, types::typed_list &out)
+{
+    return sci_http_put_post(in, opt, _iRetCount, out, "http_patch");
+}
diff --git a/scilab/modules/webtools/sci_gateway/cpp/sci_http_post.cpp b/scilab/modules/webtools/sci_gateway/cpp/sci_http_post.cpp
new file mode 100644 (file)
index 0000000..47e5d23
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+* Copyright (C) 2017 - ESI-Group - Cedric DELAMARRE
+*
+*
+* This file is hereby licensed under the terms of the GNU GPL v2.0,
+* pursuant to article 5.3.4 of the CeCILL v.2.1.
+* This file was originally licensed under the terms of the CeCILL v2.1,
+* and continues to be available under such terms.
+* For more information, see the COPYING file which you should have received
+* along with this program.
+*
+*/
+/*--------------------------------------------------------------------------*/
+
+#include "webtools_gw.hxx"
+#include "function.hxx"
+
+/*--------------------------------------------------------------------------*/
+types::Function::ReturnValue sci_http_post(types::typed_list &in, types::optional_list &opt, int _iRetCount, types::typed_list &out)
+{
+    return sci_http_put_post(in, opt, _iRetCount, out, "http_post");
+}
diff --git a/scilab/modules/webtools/sci_gateway/cpp/sci_http_put.cpp b/scilab/modules/webtools/sci_gateway/cpp/sci_http_put.cpp
new file mode 100644 (file)
index 0000000..1c543dc
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+* Copyright (C) 2017 - ESI-Group - Cedric DELAMARRE
+*
+*
+* This file is hereby licensed under the terms of the GNU GPL v2.0,
+* pursuant to article 5.3.4 of the CeCILL v.2.1.
+* This file was originally licensed under the terms of the CeCILL v2.1,
+* and continues to be available under such terms.
+* For more information, see the COPYING file which you should have received
+* along with this program.
+*
+*/
+/*--------------------------------------------------------------------------*/
+
+#include "webtools_gw.hxx"
+#include "function.hxx"
+
+/*--------------------------------------------------------------------------*/
+types::Function::ReturnValue sci_http_put(types::typed_list &in, types::optional_list &opt, int _iRetCount, types::typed_list &out)
+{
+    return sci_http_put_post(in, opt, _iRetCount, out, "http_put");
+}
diff --git a/scilab/modules/webtools/sci_gateway/cpp/sci_http_put_post.cpp b/scilab/modules/webtools/sci_gateway/cpp/sci_http_put_post.cpp
new file mode 100644 (file)
index 0000000..3876984
--- /dev/null
@@ -0,0 +1,170 @@
+/*
+* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+* Copyright (C) 2017 - ESI-Group - Cedric DELAMARRE
+*
+*
+* This file is hereby licensed under the terms of the GNU GPL v2.0,
+* pursuant to article 5.3.4 of the CeCILL v.2.1.
+* This file was originally licensed under the terms of the CeCILL v2.1,
+* and continues to be available under such terms.
+* For more information, see the COPYING file which you should have received
+* along with this program.
+*
+*/
+/*--------------------------------------------------------------------------*/
+
+#include <curl/curl.h>
+#include "webtools_gw.hxx"
+#include "function.hxx"
+#include "string.hxx"
+#include "double.hxx"
+#include "json.hxx"
+#include "sciCurl.hxx"
+
+extern "C"
+{
+#include "localization.h"
+#include "Scierror.h"
+#include "sciprint.h"
+#include "sci_malloc.h"
+}
+
+/*--------------------------------------------------------------------------*/
+types::Function::ReturnValue sci_http_put_post(types::typed_list &in, types::optional_list &opt, int _iRetCount, types::typed_list &out, const char* fname)
+{
+    SciCurl* sciCurlObj = SciCurl::getInstance();
+    CURLcode res = CURLE_OK;
+    struct curl_slist *headers = NULL;
+    bool isJson = false;
+    char* pcData = NULL;
+
+    if (in.size() < 1 || in.size() > 2)
+    {
+        Scierror(77, _("%s: Wrong number of input argument(s): %d to %d expected.\n"), fname, 1, 2);
+        return types::Function::Error;
+    }
+
+    if (_iRetCount > 2)
+    {
+        Scierror(78, _("%s: Wrong number of output argument(s): %d to %d expected.\n"), fname, 1, 2);
+        return types::Function::Error;
+    }
+
+    // get URL
+    if(in[0]->isString() == false && in[0]->getAs<types::String>()->isScalar() == false)
+    {
+        Scierror(999, _("%s: Wrong type for input argument #%d: A scalar string expected.\n"), fname, 1);
+        return types::Function::Error;
+    }
+
+    CURL* curl = curl_easy_init();
+    if(curl == nullptr)
+    {
+        Scierror(999, _("%s: CURL initialization failed.\n"), fname);
+        return types::Function::Error;
+    }
+
+    char* pcURL = wide_string_to_UTF8(in[0]->getAs<types::String>()->get(0));
+    curl_easy_setopt(curl, CURLOPT_URL, pcURL);
+    FREE(pcURL);
+
+    sciCurlObj->getResultAsObject(curl);
+    if(strcmp(fname, "http_put") == 0)
+    {
+        curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "PUT");
+    }
+    else if(strcmp(fname, "http_patch") == 0)
+    {
+        curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "PATCH");
+    }
+    else
+    {
+        curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
+    }
+
+    // common optional argument
+    if(checkCommonOpt((void*)curl, opt, fname))
+    {
+        return types::Function::Error;
+    }
+
+    // set proxy information
+    if(sciCurlObj->setProxy(curl))
+    {
+        Scierror(999, _("%s: Wrong proxy information, please check in the 'internet' Scilab preference.\n"), fname);
+        return types::Function::Error;
+    }
+
+    // specific optional argument
+    for (const auto& o : opt)
+    {
+        if(o.first == L"format")
+        {
+            if(o.second->isString() == false && o.second->getAs<types::String>()->isScalar() == false)
+            {
+                Scierror(999, _("%s: Wrong type for input argument #%s: A scalar string expected.\n"), fname, o.first.data());
+                return types::Function::Error;
+            }
+
+            if( (wcscmp(o.second->getAs<types::String>()->get(0), L"JSON") == 0) ||
+                (wcscmp(o.second->getAs<types::String>()->get(0), L"json") == 0))
+            {
+                isJson = true;
+            }
+        }
+    }
+
+    if(in.size() > 1)
+    {
+        // get data
+        if(in[1]->isString() && in[1]->getAs<types::String>()->isScalar())
+        {
+            pcData = wide_string_to_UTF8(in[1]->getAs<types::String>()->get(0));
+        }
+        else
+        {
+            pcData = os_strdup(toJSON(in[1]).c_str());
+            isJson = true;
+        }
+
+        if(isJson)
+        {
+            headers = curl_slist_append(headers, "Accept: application/json");
+            headers = curl_slist_append(headers, "Content-Type: application/json");
+            headers = curl_slist_append(headers, "charsets: utf-8");
+            curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
+        }
+
+        curl_easy_setopt(curl, CURLOPT_POSTFIELDS, pcData);
+    }
+
+    res = curl_easy_perform(curl);
+    if (pcData)
+    {
+        FREE(pcData);
+    }
+
+    if(headers)
+    {
+        curl_slist_free_all(headers);
+    }
+
+    if(res != CURLE_OK)
+    {
+        Scierror(999, _("%s: CURL execution failed.\n%s\n"), fname, curl_easy_strerror(res));
+        sciCurlObj->clear();
+        return types::Function::Error;
+    }
+
+    out.push_back(sciCurlObj->getResult());
+
+    if(_iRetCount == 2)
+    {
+        long http_code = 0;
+        curl_easy_getinfo (curl, CURLINFO_RESPONSE_CODE, &http_code);
+        out.push_back(new types::Double((double)http_code));
+    }
+
+    curl_easy_cleanup(curl);
+    return types::Function::OK;
+}
diff --git a/scilab/modules/webtools/sci_gateway/cpp/sci_http_upload.cpp b/scilab/modules/webtools/sci_gateway/cpp/sci_http_upload.cpp
new file mode 100644 (file)
index 0000000..0c02fa2
--- /dev/null
@@ -0,0 +1,225 @@
+/*
+* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+* Copyright (C) 2017 - ESI-Group - Cedric DELAMARRE
+*
+*
+* This file is hereby licensed under the terms of the GNU GPL v2.0,
+* pursuant to article 5.3.4 of the CeCILL v.2.1.
+* This file was originally licensed under the terms of the CeCILL v2.1,
+* and continues to be available under such terms.
+* For more information, see the COPYING file which you should have received
+* along with this program.
+*
+*/
+/*--------------------------------------------------------------------------*/
+
+#include <curl/curl.h>
+#include "webtools_gw.hxx"
+#include "function.hxx"
+#include "string.hxx"
+#include "double.hxx"
+#include "struct.hxx"
+#include "sciCurl.hxx"
+#include "json.hxx"
+
+extern "C"
+{
+#include "localization.h"
+#include "Scierror.h"
+#include "sciprint.h"
+#include "sci_malloc.h"
+#include "getFullFilename.h"
+}
+
+/*--------------------------------------------------------------------------*/
+static const char fname[] = "http_upload";
+types::Function::ReturnValue sci_http_upload(types::typed_list &in, types::optional_list &opt, int _iRetCount, types::typed_list &out)
+{
+    SciCurl* sciCurlObj = SciCurl::getInstance();
+    CURLcode res = CURLE_OK;
+
+    if (in.size() < 3 || in.size() > 4)
+    {
+        Scierror(77, _("%s: Wrong number of input argument(s): %d to %d expected.\n"), fname, 3, 4);
+        return types::Function::Error;
+    }
+
+    if (_iRetCount > 2)
+    {
+        Scierror(78, _("%s: Wrong number of output argument(s): %d to %d expected.\n"), fname, 1, 2);
+        return types::Function::Error;
+    }
+
+    // get URL
+    if(in[0]->isString() == false && in[0]->getAs<types::String>()->isScalar() == false)
+    {
+        Scierror(999, _("%s: Wrong type for input argument #%d: A scalar string expected.\n"), fname, 1);
+        return types::Function::Error;
+    }
+
+    CURL* curl = curl_easy_init();
+    if(curl == nullptr)
+    {
+        Scierror(999, _("%s: CURL initialization failed.\n"), fname);
+        return types::Function::Error;
+    }
+
+    char* pcURL = wide_string_to_UTF8(in[0]->getAs<types::String>()->get(0));
+    curl_easy_setopt(curl, CURLOPT_URL, pcURL);
+    FREE(pcURL);
+
+    // get input file name
+    if(in[1]->isString() == false)
+    {
+        Scierror(999, _("%s: Wrong type for input argument #%d: A matrix string expected.\n"), fname, 2);
+        return types::Function::Error;
+    }
+
+    types::String* pStrFiles = in[1]->getAs<types::String>();
+    std::vector<char*> files;
+    for(int i = 0; i < pStrFiles->getSize(); i++)
+    {
+        wchar_t* pwcFileName = getFullFilenameW(pStrFiles->get(i));
+        files.push_back(wide_string_to_UTF8(pwcFileName));
+        FREE(pwcFileName);
+    }
+
+    // get variable name server side
+    if(in[2]->isString() == false && in[2]->getAs<types::String>()->isScalar() == false)
+    {
+        Scierror(999, _("%s: Wrong type for input argument #%d: A scalar string expected.\n"), fname, 3);
+        return types::Function::Error;
+    }
+
+    char* pcVarName = wide_string_to_UTF8(in[2]->getAs<types::String>()->get(0));
+
+    struct curl_httppost *formpost = NULL;
+    struct curl_httppost *lastptr  = NULL;
+
+    // /!\ This doesn't work with nodejs multer array /!\
+    // struct curl_forms form[files.size()+1];
+    // int iter = 0;
+    // for(auto f : files)
+    // {
+    //     form[iter].option  = CURLFORM_FILE;
+    //     form[iter++].value = f;
+    // }
+    //
+    // form[iter].option = CURLFORM_END;
+    //
+    // curl_formadd(&formpost,
+    //              &lastptr,
+    //              CURLFORM_COPYNAME, pcVarName,
+    //              CURLFORM_ARRAY, form,
+    //              CURLFORM_END);
+
+    for(auto f : files)
+    {
+        curl_formadd(&formpost,
+                     &lastptr,
+                     CURLFORM_COPYNAME, pcVarName,
+                     CURLFORM_FILE, f,
+                     CURLFORM_END);
+    }
+
+    if(in.size() > 3)
+    {
+        // get data
+        if(in[3]->isStruct() == false && in[3]->getAs<types::Struct>()->isScalar() == false)
+        {
+            Scierror(999, _("%s: Wrong type for input argument #%d: A structure of size %d expected.\n"), fname, 3, 1);
+            return types::Function::Error;
+        }
+
+        types::Struct* pStruct = in[3]->getAs<types::Struct>();
+        std::unordered_map<std::wstring, int> fieldsMap = pStruct->get(0)->getFields();
+        std::vector<types::InternalType*> pITData = pStruct->get(0)->getData();
+        for (const auto & field : fieldsMap)
+        {
+            char* pcFieldName = wide_string_to_UTF8(field.first.data());
+            std::string strData(toJSON(pITData[field.second]));
+            //remove " @start and @end of string
+            if (strData.front() == '\"' && strData.back() == '\"')
+            {
+                strData = strData.substr(1);
+                strData.pop_back();
+            }
+            sciprint("|%s|: |%s|\n", pcFieldName, strData.data());
+            curl_formadd(&formpost,
+                         &lastptr,
+                         CURLFORM_COPYNAME, pcFieldName,
+                         CURLFORM_COPYCONTENTS, strData.data(),
+                         CURLFORM_END);
+
+            FREE(pcFieldName);
+        }
+    }
+
+    curl_easy_setopt(curl, CURLOPT_HTTPPOST, formpost);
+
+    // set proxy information
+    if(sciCurlObj->setProxy(curl))
+    {
+        Scierror(999, _("%s: Wrong proxy information, please check in the 'internet' Scilab preference.\n"), fname);
+        return types::Function::Error;
+    }
+
+    // common optional argument
+    if(checkCommonOpt((void*)curl, opt, fname))
+    {
+        return types::Function::Error;
+    }
+
+    // specific optional argument
+    for (const auto& o : opt)
+    {
+        if (o.first == L"method")
+        {
+            if(o.second->isString() == false && o.second->getAs<types::String>()->isScalar() == false)
+            {
+                Scierror(999, _("%s: Wrong type for input argument #%s: A scalar string expected.\n"), fname, o.first.data());
+                return types::Function::Error;
+            }
+
+            wchar_t* pMeth = o.second->getAs<types::String>()->get(0);
+            if(wcscmp(pMeth, L"PUT") == 0)
+            {
+                curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "PUT");
+            }
+            else if(wcscmp(pMeth, L"POST") != 0)
+            {
+                Scierror(999, _("%s: Wrong value for input argument #%s: 'PUT' or 'POST' expected.\n"), fname, o.first.data());
+                return types::Function::Error;
+            }
+        }
+    }
+
+    sciCurlObj->getResultAsObject(curl);
+    res = curl_easy_perform(curl);
+    for(auto f : files)
+    {
+        FREE(f);
+    }
+
+    FREE(pcVarName);
+    curl_formfree(formpost);
+
+    if(res != CURLE_OK)
+    {
+        Scierror(999, _("%s: CURL execution failed.\n%s\n"), fname, curl_easy_strerror(res));
+        sciCurlObj->clear();
+        return types::Function::Error;
+    }
+
+    out.push_back(sciCurlObj->getResult());
+
+    if(_iRetCount == 2)
+    {
+        long http_code = 0;
+        curl_easy_getinfo (curl, CURLINFO_RESPONSE_CODE, &http_code);
+        out.push_back(new types::Double((double)http_code));
+    }
+
+    curl_easy_cleanup(curl);
+    return types::Function::OK;
+}
diff --git a/scilab/modules/webtools/sci_gateway/cpp/sci_toJSON.cpp b/scilab/modules/webtools/sci_gateway/cpp/sci_toJSON.cpp
new file mode 100644 (file)
index 0000000..12ac033
--- /dev/null
@@ -0,0 +1,186 @@
+/*
+* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+* Copyright (C) 2017 - ESI-Group - Antoine ELIAS
+*
+*
+* This file is hereby licensed under the terms of the GNU GPL v2.0,
+* pursuant to article 5.3.4 of the CeCILL v.2.1.
+* This file was originally licensed under the terms of the CeCILL v2.1,
+* and continues to be available under such terms.
+* For more information, see the COPYING file which you should have received
+* along with this program.
+*
+*/
+/*--------------------------------------------------------------------------*/
+
+#include <sstream>
+#include <string>
+#include <fstream>
+#include <iomanip>
+#include <vector>
+#include <regex>
+#include <chrono>
+
+#define __API_SCILAB_UNSAFE__
+#include "json.hxx"
+
+//#define SHOW_TIMER
+
+extern "C"
+{
+#include "gw_webtools.h"
+#include "api_scilab.h"
+#include "Scierror.h"
+#include "sciprint.h"
+#include "sci_malloc.h"
+#include <localization.h>
+}
+
+bool exportJSON(scilabEnv env, scilabVar var, int indent, const std::wstring &file, scilabVar* const  out);
+bool export_data(scilabEnv env, scilabVar var, int indent, std::wostringstream &os);
+
+const std::string name("toJSON");
+
+//A: toJSON(x) -> return inline string
+//B: toJSON(x, y) -> return string array with y spaces increment
+//C: toJSON(x, "file") -> write JSON in file return %t/%f
+//D: toJSON(x, y, "file") -> write JSON in file with indention return %t/%f
+/* ==================================================================== */
+
+int sci_toJSON(scilabEnv env, int nin, scilabVar *in, int nopt, scilabOpt opt, int nout, scilabVar *out)
+{
+#ifdef SHOW_TIMER
+    std::chrono::steady_clock::time_point ttotal = std::chrono::steady_clock::now();
+    std::chrono::steady_clock::time_point tinput = std::chrono::steady_clock::now();
+#endif
+
+    int indent = 0;
+    std::wstring file;
+
+    if (nin < 1 && nin > 3)
+    {
+        Scierror(999, _("%s: Wrong number of input arguments: %d to %d expected.\n"), name.data(), 1, 3);
+        return STATUS_ERROR;
+    }
+
+    switch (nin)
+    {
+        case 1:
+            //OK
+            break;
+
+        case 2:
+        {
+            //must be a scalar double or single string
+            if ((!scilab_isDouble(env, in[1]) && !scilab_isString(env, in[1])) || !scilab_isScalar(env, in[1]))
+            {
+                Scierror(999, "%s: Wrong type for input argument #%d: double or string expected.\n", name.data(), 2);
+                return STATUS_ERROR;
+            }
+
+            if (scilab_isDouble(env, in[1]))
+            {
+                double dbl = 0;
+                scilab_getDouble(env, in[1], &dbl);
+                indent = (int)dbl;
+            }
+            else
+            {
+                //string
+                wchar_t *wf = nullptr;
+                scilab_getString(env, in[1], &wf);
+                file = wf;
+            }
+            break;
+        }
+        case 3:
+        {
+            //must be a scalar double or single string
+            if (!scilab_isDouble(env, in[1]) && !scilab_isScalar(env, in[1]))
+            {
+                Scierror(999, "%s: Wrong type for input argument #%d: double expected.\n", name.data(), 2);
+                return STATUS_ERROR;
+            }
+
+            double dbl = 0;
+            scilab_getDouble(env, in[1], &dbl);
+            indent = (int)dbl;
+
+            //must be a scalar double or single string
+            if (!scilab_isString(env, in[2]) && !isScalar(env, in[2]))
+            {
+                Scierror(999, "%s: Wrong type for input argument #%d: string expected.\n", name.data(), 3);
+                return STATUS_ERROR;
+            }
+
+            //string
+            wchar_t *wf = nullptr;
+            scilab_getString(env, in[2], &wf);
+            file = wf;
+            break;
+        }
+
+        default:
+        {
+            Scierror(999, "%s: bad input arguments.\n", name.data());
+            return STATUS_ERROR;
+        }
+    }
+
+#ifdef SHOW_TIMER
+    std::chrono::steady_clock::time_point tinputend = std::chrono::steady_clock::now();
+    sciprint("Input\t: %d ms\n", std::chrono::duration_cast<std::chrono::milliseconds>(tinputend - tinput).count());
+#endif
+
+    exportJSON(env, in[0], indent, file, out);
+
+#ifdef SHOW_TIMER
+    std::chrono::steady_clock::time_point ttotalend = std::chrono::steady_clock::now();
+    sciprint("Total\t: %d ms\n", std::chrono::duration_cast<std::chrono::milliseconds>(ttotalend - ttotal).count());
+#endif
+
+    return 0;
+}
+
+bool exportJSON(scilabEnv env, scilabVar var, int indent, const std::wstring& file, scilabVar* const out)
+{
+#ifdef SHOW_TIMER
+    std::chrono::steady_clock::time_point tprocess = std::chrono::steady_clock::now();
+#endif
+
+    std::string s = toJSON(env, var, indent);
+
+#ifdef SHOW_TIMER
+    std::chrono::steady_clock::time_point tprocessend = std::chrono::steady_clock::now();
+    sciprint("Process\t: %d ms\n", std::chrono::duration_cast<std::chrono::milliseconds>(tprocessend - tprocess).count());
+
+    std::chrono::steady_clock::time_point toutput = std::chrono::steady_clock::now();
+#endif
+
+    if (file.empty() == false)
+    {
+        char *_filename = wide_string_to_UTF8(file.c_str());
+        if (_filename == NULL)
+        {
+            return false;
+        }
+
+        std::ofstream outfile(_filename);
+        outfile << s.data();
+        outfile.close();
+        FREE(_filename);
+    }
+    else
+    {
+        wchar_t* w = to_wide_string(s.data());
+        out[0] = scilab_createString(env, w);
+        FREE(w);
+    }
+
+#ifdef SHOW_TIMER
+    std::chrono::steady_clock::time_point toutputend = std::chrono::steady_clock::now();
+    sciprint("Output\t: %d ms\n", std::chrono::duration_cast<std::chrono::milliseconds>(toutputend - toutput).count());
+#endif
+
+    return true;
+}
diff --git a/scilab/modules/webtools/sci_gateway/webtools_gateway.xml b/scilab/modules/webtools/sci_gateway/webtools_gateway.xml
new file mode 100644 (file)
index 0000000..bb0c60f
--- /dev/null
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE module SYSTEM "../../functions/xml/gateway.dtd">
+<!--
+/*
+ *  Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ *  Copyright (C) 2012 - Scilab Enterprises - Cedric DELAMARRE
+ *
+ * Copyright (C) 2012 - 2016 - Scilab Enterprises
+ * Copyright (C) 2017 - ESI-Group
+ *
+ * This file is hereby licensed under the terms of the GNU GPL v2.0,
+ * pursuant to article 5.3.4 of the CeCILL v.2.1.
+ * This file was originally licensed under the terms of the CeCILL v2.1,
+ * and continues to be available under such terms.
+ * For more information, see the COPYING file which you should have received
+ * along with this program.
+ *
+ */
+ Scilab
+ Interface description. In this file, we define the list of the function which
+ will be available into Scilab and the link to the "native" function.
+
+ Don't touch if you do not know what you are doing
+-->
+<module name="webtools">
+    <gateway name="sci_http_get"        function="http_get"     type="3" />
+    <gateway name="sci_http_post"       function="http_post"    type="3" />
+    <gateway name="sci_http_put"        function="http_put"     type="3" />
+    <gateway name="sci_http_patch"      function="http_patch"   type="3" />
+    <gateway name="sci_http_delete"     function="http_delete"  type="3" />
+    <gateway name="sci_http_upload"     function="http_upload"  type="3" />
+    <gateway name="sci_toJSON"          function="toJSON"       type="4" />
+    <gateway name="sci_fromJSON"        function="fromJSON"     type="4" />
+</module>
diff --git a/scilab/modules/webtools/src/c/DllmainWebtools.c b/scilab/modules/webtools/src/c/DllmainWebtools.c
new file mode 100644 (file)
index 0000000..7f6e589
--- /dev/null
@@ -0,0 +1,74 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2009 - DIGITEO  -
+ *
+ * Copyright (C) 2012 - 2016 - Scilab Enterprises
+ * Copyright (C) 2017 - ESI-Group
+ *
+ * This file is hereby licensed under the terms of the GNU GPL v2.0,
+ * pursuant to article 5.3.4 of the CeCILL v.2.1.
+ * This file was originally licensed under the terms of the CeCILL v2.1,
+ * and continues to be available under such terms.
+ * For more information, see the COPYING file which you should have received
+ * along with this program.
+ *
+ */
+
+#include "webtools.h"
+
+#ifdef _MSC_VER
+#include <windows.h>
+
+#pragma comment(lib, "../../bin/libcurl.lib")
+#pragma comment(lib, "../../bin/libintl.lib")
+/*--------------------------------------------------------------------------*/
+//for Visual Leak Detector in debug compilation mode
+//#define DEBUG_VLD
+#if defined(DEBUG_VLD) && defined(_DEBUG)
+#include <vld.h>
+#endif
+/*--------------------------------------------------------------------------*/
+int WINAPI DllMain(HINSTANCE hinstDLL, DWORD flag, LPVOID reserved)
+{
+    switch (flag)
+    {
+        case DLL_PROCESS_ATTACH :
+        {
+            Initialize_Webtools();
+            break;
+        }
+        case DLL_PROCESS_DETACH :
+        {
+            Finalize_Webtools();
+            break;
+        }
+        case DLL_THREAD_ATTACH :
+        {
+            break;
+        }
+        case DLL_THREAD_DETACH :
+        {
+            break;
+        }
+        default :
+        {
+            return 0;
+        }
+    }
+    return 1;
+}
+#else
+void __attribute__ ((constructor)) load_curl(void);
+void __attribute__ ((destructor)) unload_curl(void);
+
+void load_curl(void)
+{
+    Initialize_Webtools();
+}
+
+void unload_curl(void)
+{
+    Finalize_Webtools();
+}
+#endif
+/*--------------------------------------------------------------------------*/
diff --git a/scilab/modules/webtools/src/c/jsmn.c b/scilab/modules/webtools/src/c/jsmn.c
new file mode 100644 (file)
index 0000000..cdd2813
--- /dev/null
@@ -0,0 +1,338 @@
+/*
+* Copyright (c) 2010 Serge A. Zaitsev
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the "Software"), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+* THE SOFTWARE.
+*
+* https://github.com/zserge/jsmn
+*
+*/
+
+#include "jsmn.h"
+
+/**
+* Allocates a fresh unused token from the token pull.
+*/
+static jsmntok_t *jsmn_alloc_token(jsmn_parser *parser,
+    jsmntok_t *tokens, size_t num_tokens) {
+    jsmntok_t *tok;
+    if (parser->toknext >= num_tokens) {
+        return NULL;
+    }
+    tok = &tokens[parser->toknext++];
+    tok->start = tok->end = -1;
+    tok->size = 0;
+#ifdef JSMN_PARENT_LINKS
+    tok->parent = -1;
+#endif
+    return tok;
+}
+
+/**
+* Fills token type and boundaries.
+*/
+static void jsmn_fill_token(jsmntok_t *token, jsmntype_t type,
+    int start, int end) {
+    token->type = type;
+    token->start = start;
+    token->end = end;
+    token->size = 0;
+}
+
+/**
+* Fills next available token with JSON primitive.
+*/
+static int jsmn_parse_primitive(jsmn_parser *parser, const char *js,
+    size_t len, jsmntok_t *tokens, size_t num_tokens) {
+    jsmntok_t *token;
+    int start;
+
+    start = parser->pos;
+
+    for (; parser->pos < len && js[parser->pos] != '\0'; parser->pos++) {
+        switch (js[parser->pos]) {
+#ifndef JSMN_STRICT
+            /* In strict mode primitive must be followed by "," or "}" or "]" */
+            case ':':
+#endif
+            case '\t': case '\r': case '\n': case ' ':
+            case ',': case ']': case '}':
+                goto found;
+        }
+        if (js[parser->pos] < 32 || js[parser->pos] >= 127) {
+            parser->pos = start;
+            return JSMN_ERROR_INVAL;
+        }
+    }
+#ifdef JSMN_STRICT
+    /* In strict mode primitive must be followed by a comma/object/array */
+    parser->pos = start;
+    return JSMN_ERROR_PART;
+#endif
+
+found:
+    if (tokens == NULL) {
+        parser->pos--;
+        return 0;
+    }
+    token = jsmn_alloc_token(parser, tokens, num_tokens);
+    if (token == NULL) {
+        parser->pos = start;
+        return JSMN_ERROR_NOMEM;
+    }
+    jsmn_fill_token(token, JSMN_PRIMITIVE, start, parser->pos);
+#ifdef JSMN_PARENT_LINKS
+    token->parent = parser->toksuper;
+#endif
+    parser->pos--;
+    return 0;
+}
+
+/**
+* Fills next token with JSON string.
+*/
+static int jsmn_parse_string(jsmn_parser *parser, const char *js,
+    size_t len, jsmntok_t *tokens, size_t num_tokens) {
+    jsmntok_t *token;
+
+    int start = parser->pos;
+
+    parser->pos++;
+
+    /* Skip starting quote */
+    for (; parser->pos < len && js[parser->pos] != '\0'; parser->pos++) {
+        char c = js[parser->pos];
+
+        /* Quote: end of string */
+        if (c == '\"') {
+            if (tokens == NULL) {
+                return 0;
+            }
+            token = jsmn_alloc_token(parser, tokens, num_tokens);
+            if (token == NULL) {
+                parser->pos = start;
+                return JSMN_ERROR_NOMEM;
+            }
+            jsmn_fill_token(token, JSMN_STRING, start + 1, parser->pos);
+#ifdef JSMN_PARENT_LINKS
+            token->parent = parser->toksuper;
+#endif
+            return 0;
+        }
+
+        /* Backslash: Quoted symbol expected */
+        if (c == '\\' && parser->pos + 1 < len) {
+            int i;
+            parser->pos++;
+            switch (js[parser->pos]) {
+                /* Allowed escaped symbols */
+                case '\"': case '/': case '\\': case 'b':
+                case 'f': case 'r': case 'n': case 't':
+                    break;
+                    /* Allows escaped symbol \uXXXX */
+                case 'u':
+                    parser->pos++;
+                    for (i = 0; i < 4 && parser->pos < len && js[parser->pos] != '\0'; i++) {
+                        /* If it isn't a hex character we have an error */
+                        if (!((js[parser->pos] >= 48 && js[parser->pos] <= 57) || /* 0-9 */
+                            (js[parser->pos] >= 65 && js[parser->pos] <= 70) || /* A-F */
+                            (js[parser->pos] >= 97 && js[parser->pos] <= 102))) { /* a-f */
+                            parser->pos = start;
+                            return JSMN_ERROR_INVAL;
+                        }
+                        parser->pos++;
+                    }
+                    parser->pos--;
+                    break;
+                    /* Unexpected symbol */
+                default:
+                    parser->pos = start;
+                    return JSMN_ERROR_INVAL;
+            }
+        }
+    }
+    parser->pos = start;
+    return JSMN_ERROR_PART;
+}
+
+/**
+* Parse JSON string and fill tokens.
+*/
+int jsmn_parse(jsmn_parser *parser, const char *js, size_t len,
+    jsmntok_t *tokens, unsigned int num_tokens) {
+    int r;
+    int i;
+    jsmntok_t *token;
+    int count = parser->toknext;
+
+    for (; parser->pos < len && js[parser->pos] != '\0'; parser->pos++) {
+        char c;
+        jsmntype_t type;
+
+        c = js[parser->pos];
+        switch (c) {
+            case '{': case '[':
+                count++;
+                if (tokens == NULL) {
+                    break;
+                }
+                token = jsmn_alloc_token(parser, tokens, num_tokens);
+                if (token == NULL)
+                    return JSMN_ERROR_NOMEM;
+                if (parser->toksuper != -1) {
+                    tokens[parser->toksuper].size++;
+#ifdef JSMN_PARENT_LINKS
+                    token->parent = parser->toksuper;
+#endif
+                }
+                token->type = (c == '{' ? JSMN_OBJECT : JSMN_ARRAY);
+                token->start = parser->pos;
+                parser->toksuper = parser->toknext - 1;
+                break;
+            case '}': case ']':
+                if (tokens == NULL)
+                    break;
+                type = (c == '}' ? JSMN_OBJECT : JSMN_ARRAY);
+#ifdef JSMN_PARENT_LINKS
+                if (parser->toknext < 1) {
+                    return JSMN_ERROR_INVAL;
+                }
+                token = &tokens[parser->toknext - 1];
+                for (;;) {
+                    if (token->start != -1 && token->end == -1) {
+                        if (token->type != type) {
+                            return JSMN_ERROR_INVAL;
+                        }
+                        token->end = parser->pos + 1;
+                        parser->toksuper = token->parent;
+                        break;
+                    }
+                    if (token->parent == -1) {
+                        if (token->type != type || parser->toksuper == -1) {
+                            return JSMN_ERROR_INVAL;
+                        }
+                        break;
+                    }
+                    token = &tokens[token->parent];
+                }
+#else
+                for (i = parser->toknext - 1; i >= 0; i--) {
+                    token = &tokens[i];
+                    if (token->start != -1 && token->end == -1) {
+                        if (token->type != type) {
+                            return JSMN_ERROR_INVAL;
+                        }
+                        parser->toksuper = -1;
+                        token->end = parser->pos + 1;
+                        break;
+                    }
+                }
+                /* Error if unmatched closing bracket */
+                if (i == -1) return JSMN_ERROR_INVAL;
+                for (; i >= 0; i--) {
+                    token = &tokens[i];
+                    if (token->start != -1 && token->end == -1) {
+                        parser->toksuper = i;
+                        break;
+                    }
+                }
+#endif
+                break;
+            case '\"':
+                r = jsmn_parse_string(parser, js, len, tokens, num_tokens);
+                if (r < 0) return r;
+                count++;
+                if (parser->toksuper != -1 && tokens != NULL)
+                    tokens[parser->toksuper].size++;
+                break;
+            case '\t': case '\r': case '\n': case ' ':
+                break;
+            case ':':
+                parser->toksuper = parser->toknext - 1;
+                break;
+            case ',':
+                if (tokens != NULL && parser->toksuper != -1 &&
+                    tokens[parser->toksuper].type != JSMN_ARRAY &&
+                    tokens[parser->toksuper].type != JSMN_OBJECT) {
+#ifdef JSMN_PARENT_LINKS
+                    parser->toksuper = tokens[parser->toksuper].parent;
+#else
+                    for (i = parser->toknext - 1; i >= 0; i--) {
+                        if (tokens[i].type == JSMN_ARRAY || tokens[i].type == JSMN_OBJECT) {
+                            if (tokens[i].start != -1 && tokens[i].end == -1) {
+                                parser->toksuper = i;
+                                break;
+                            }
+                        }
+                    }
+#endif
+                }
+                break;
+#ifdef JSMN_STRICT
+                /* In strict mode primitives are: numbers and booleans */
+            case '-': case '0': case '1': case '2': case '3': case '4':
+            case '5': case '6': case '7': case '8': case '9':
+            case 't': case 'f': case 'n':
+                /* And they must not be keys of the object */
+                if (tokens != NULL && parser->toksuper != -1) {
+                    jsmntok_t *t = &tokens[parser->toksuper];
+                    if (t->type == JSMN_OBJECT ||
+                        (t->type == JSMN_STRING && t->size != 0)) {
+                        return JSMN_ERROR_INVAL;
+                    }
+                }
+#else
+                /* In non-strict mode every unquoted value is a primitive */
+            default:
+#endif
+                r = jsmn_parse_primitive(parser, js, len, tokens, num_tokens);
+                if (r < 0) return r;
+                count++;
+                if (parser->toksuper != -1 && tokens != NULL)
+                    tokens[parser->toksuper].size++;
+                break;
+
+#ifdef JSMN_STRICT
+                /* Unexpected char in strict mode */
+            default:
+                return JSMN_ERROR_INVAL;
+#endif
+        }
+    }
+
+    if (tokens != NULL) {
+        for (i = parser->toknext - 1; i >= 0; i--) {
+            /* Unmatched opened object or array */
+            if (tokens[i].start != -1 && tokens[i].end == -1) {
+                return JSMN_ERROR_PART;
+            }
+        }
+    }
+
+    return count;
+}
+
+/**
+* Creates a new parser based over a given  buffer with an array of tokens
+* available.
+*/
+void jsmn_init(jsmn_parser *parser) {
+    parser->pos = 0;
+    parser->toknext = 0;
+    parser->toksuper = -1;
+}
diff --git a/scilab/modules/webtools/src/c/jsmn.h b/scilab/modules/webtools/src/c/jsmn.h
new file mode 100644 (file)
index 0000000..99c3278
--- /dev/null
@@ -0,0 +1,101 @@
+/*
+* Copyright (c) 2010 Serge A. Zaitsev
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the "Software"), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+* THE SOFTWARE.
+*
+* https://github.com/zserge/jsmn
+*
+*/
+
+#ifndef __JSMN_H_
+#define __JSMN_H_
+
+#include <stddef.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+    /**
+    * JSON type identifier. Basic types are:
+    *  o Object
+    *  o Array
+    *  o String
+    *  o Other primitive: number, boolean (true/false) or null
+    */
+    typedef enum {
+        JSMN_UNDEFINED = 0,
+        JSMN_OBJECT = 1,
+        JSMN_ARRAY = 2,
+        JSMN_STRING = 3,
+        JSMN_PRIMITIVE = 4
+    } jsmntype_t;
+
+    enum jsmnerr {
+        /* Not enough tokens were provided */
+        JSMN_ERROR_NOMEM = -1,
+        /* Invalid character inside JSON string */
+        JSMN_ERROR_INVAL = -2,
+        /* The string is not a full JSON packet, more bytes expected */
+        JSMN_ERROR_PART = -3
+    };
+
+    /**
+    * JSON token description.
+    * type             type (object, array, string etc.)
+    * start    start position in JSON data string
+    * end              end position in JSON data string
+    */
+    typedef struct {
+        jsmntype_t type;
+        int start;
+        int end;
+        int size;
+#ifdef JSMN_PARENT_LINKS
+        int parent;
+#endif
+    } jsmntok_t;
+
+    /**
+    * JSON parser. Contains an array of token blocks available. Also stores
+    * the string being parsed now and current position in that string
+    */
+    typedef struct {
+        unsigned int pos; /* offset in the JSON string */
+        unsigned int toknext; /* next token to allocate */
+        int toksuper; /* superior token node, e.g parent object or array */
+    } jsmn_parser;
+
+    /**
+    * Create JSON parser over an array of tokens
+    */
+    void jsmn_init(jsmn_parser *parser);
+
+    /**
+    * Run JSON parser. It parses a JSON data string into and array of tokens, each describing
+    * a single JSON object.
+    */
+    int jsmn_parse(jsmn_parser *parser, const char *js, size_t len,
+        jsmntok_t *tokens, unsigned int num_tokens);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __JSMN_H_ */
diff --git a/scilab/modules/webtools/src/cpp/json.cpp b/scilab/modules/webtools/src/cpp/json.cpp
new file mode 100644 (file)
index 0000000..d341909
--- /dev/null
@@ -0,0 +1,1202 @@
+/*
+*  Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+*  Copyright (C) 2016 - Scilab Enterprises - Antoine ELIAS
+*
+* Copyright (C) 2012 - 2016 - Scilab Enterprises
+*
+*/
+
+#include "json.hxx"
+
+#include <string>
+#include <fstream>
+#include <sstream>
+#include <iomanip>
+#include <vector>
+#include <regex>
+#include <chrono>
+
+
+extern "C"
+{
+#define __API_SCILAB_UNSAFE__
+#include "api_scilab.h"
+#include "jsmn.h"
+#include "os_string.h"
+}
+
+//
+// toJSON
+//
+
+static bool export_data(scilabEnv env, scilabVar var, int indent, std::wostringstream& os);
+
+int level = -1;
+
+static double printType(double dbl)
+{
+    return dbl;
+}
+
+static void string_replace(std::wstring& str, const std::wstring& f, const std::wstring& r)
+{
+    size_t pos = str.find(f);
+    if (pos == std::wstring::npos)
+    {
+        return;
+    }
+
+    str.replace(pos, f.length(), r);
+}
+
+static std::wstring printType(const std::wstring& s)
+{
+    std::wstring str = s;
+    string_replace(str, L"\\", L"\\\\");
+    string_replace(str, L"\"", L"\\\"");
+    string_replace(str, L"\t", L"\\\t");
+
+    return L"\"" + str + L"\"";
+}
+
+std::wstring printType(int b)
+{
+    return b ? L"true" : L"false";
+}
+
+template<typename T>
+static void getDataInLine(const T d, int rows, int cols, int line, std::wostringstream& os)
+{
+    //row vector [...]
+    os << L"[";
+    if (cols)
+    {
+        os << printType(d[line]);
+    }
+
+    for (int i = 1; i < cols; ++i)
+    {
+        os << L", ";
+        os << printType(d[i * rows + line]);
+    }
+
+    os << L"]";
+}
+
+template<typename T>
+static bool export_type(int rows, int cols, T data, int indent, std::wostringstream& os)
+{
+    std::wstring indentStr;
+    std::wstring indentStr2;
+    if (indent)
+    {
+        indentStr = L"\n" + std::wstring(indent * level, L' ');
+        indentStr2 = L"\n" + std::wstring(indent * (level + 1), L' ');
+    }
+
+    if (rows == 0 && cols == 0)
+    {
+        os << L"[]";
+        return true;
+    }
+
+    if (rows == 1 && cols == 1)
+    {
+        os << printType(data[0]);
+        return true;
+    }
+
+    if (rows == 1)
+    {
+        getDataInLine(data, rows, cols, 0, os);
+        return true;
+    }
+
+    if (cols == 1)
+    {
+        os << L"[";
+        os << indentStr2;
+        os << L"[" << printType(data[0]) << L"]";
+
+        for (int i = 1; i < rows; ++i)
+        {
+            os << L", ";
+            os << indentStr2;
+            os << L"[" << printType(data[i]) << L"]";
+        }
+
+        os << indentStr;
+        os << L"]";
+        return true;
+    }
+
+    //matrix
+
+    os << L"[";
+    os << indentStr2;
+    getDataInLine(data, rows, cols, 0, os);
+    for (int i = 1; i < rows; ++i)
+    {
+        os << L",";
+        os << indentStr2;
+        getDataInLine(data, rows, cols, i, os);
+    }
+
+    os << indentStr;
+    os << L"]";
+
+    return true;
+}
+
+static bool export_struct(scilabEnv env, int indent, const std::vector<wchar_t*>& fields, const std::vector<scilabVar> data, std::wostringstream& os)
+{
+    std::wstring indentStr;
+    std::wstring indentStr2;
+    if (indent)
+    {
+        indentStr = L"\n" + std::wstring(indent * level, L' ');
+        indentStr2 = L"\n" + std::wstring(indent * (level + 1), L' ');
+    }
+
+    if (fields.size() == 0)
+    {
+        os << L"{}";
+        return true;
+    }
+
+    os << L"{";
+    os << indentStr2;
+    os << L"\"" << fields[0] << L"\": ";
+    export_data(env, data[0], indent, os);
+
+    int size = (int)fields.size();
+    for (int i = 1; i < size; ++i)
+    {
+        os << L",";
+        os << indentStr2;
+        os << L"\"" << fields[i] << L"\": ";
+        export_data(env, data[i], indent, os);
+    }
+
+    os << indentStr;
+    os << L"}";
+
+    return true;
+}
+
+static bool export_struct_array(scilabEnv env, int indent, const std::vector<wchar_t*>& fields, scilabVar var, std::wostringstream& os)
+{
+    int* dims = nullptr;
+    int dim = scilab_getDimArray(env, var, &dims);
+
+    if (dim == 2 && dims[0] == 1 && dims[1] == 1)
+    {
+        int size = (int)fields.size();
+        std::vector<scilabVar> data(size);
+        for (int i = 0; i < size; ++i)
+        {
+            data[i] = scilab_getStructMatrix2dData(env, var, fields[i], 0, 0);
+        }
+        //scalar
+        return export_struct(env, indent, fields, data, os);
+    }
+
+    std::wstring indentStr;
+    std::wstring indentStr2;
+    if (indent)
+    {
+        indentStr = L"\n" + std::wstring(indent * level, L' ');
+        indentStr2 = L"\n" + std::wstring(indent * (level + 1), L' ');
+    }
+
+    int size = 1;
+    for (int i = 0; i < dim; ++i)
+    {
+        size *= dims[i];
+    }
+
+    //build data for each dimensions
+    std::vector<std::vector<scilabVar>> d(size);
+    int size2d = dims[0] * dims[1];
+    for (int i = 0; i < size; ++i)
+    {
+        //take care of dim > 2
+        int extra = (i / size2d);
+        int mem = i % (size2d);
+        //convert i to row-major 2d index;
+        int m = mem % dims[0];
+        int n = mem / dims[0];
+
+        //convert to col-major
+        int idx = m * dims[1] + n + extra * size2d;
+
+        for (int f = 0; f < fields.size(); ++f)
+        {
+            scilabVar v = scilab_getStructMatrix2dData(env, var, fields[f], m, n);
+            d[idx].push_back(v);
+        }
+    }
+
+    os << L"[";
+    os << indentStr2;
+
+    for (int i = 0; i < dims[0]; ++i)
+    {
+        if (i != 0)
+        {
+            os << L",";
+        }
+
+        if (dims[0] != 1) {
+            os << L"[";
+        }
+
+        for (int j = 0; j < dims[1]; ++j)
+        {
+            if (j != 0)
+            {
+                os << L",";
+            }
+            level++;
+            export_struct(env, indent, fields, d[i * dims[1] + j], os);
+            level--;
+        }
+
+        if (dims[0] != 1) {
+            os << L"]";
+        }
+    }
+    os << indentStr;
+    os << L"]";
+
+    return true;
+}
+
+
+static bool export_data(scilabEnv env, scilabVar var, int indent, std::wostringstream& os)
+{
+    ++level;
+
+    bool ret = false;
+    switch (scilab_getType(env, var))
+    {
+        case sci_matrix: //double
+        {
+            os << std::setprecision(std::numeric_limits<long double>::digits10 + 1);
+            int rows = 0;
+            int cols = 0;
+            double* d = nullptr;
+            scilab_getDim2d(env, var, &rows, &cols);
+            scilab_getDoubleArray(env, var, &d);
+            ret = export_type(rows, cols, d, indent, os);
+            break;
+        }
+
+        case sci_boolean: //boolean
+        {
+            int rows = 0;
+            int cols = 0;
+            int* b = nullptr;
+            scilab_getDim2d(env, var, &rows, &cols);
+            scilab_getBooleanArray(env, var, &b);
+            ret = export_type(rows, cols, b, indent, os);
+            break;
+        }
+
+        case sci_strings: //string
+        {
+            int rows = 0;
+            int cols = 0;
+            wchar_t** s = nullptr;
+            scilab_getDim2d(env, var, &rows, &cols);
+            scilab_getStringArray(env, var, &s);
+
+            ret = export_type(rows, cols, s, indent, os);
+            break;
+        }
+
+        case sci_list: //list
+        {
+            //lists become a heterogeous array
+            int count = scilab_getSize(env, var);
+            if (count == 0)
+            {
+                os << L"[]";
+                return true;
+            }
+
+            std::wstring indentStr;
+            std::wstring indentStr2;
+            if (indent)
+            {
+                indentStr = L"\n" + std::wstring(indent * level, L' ');
+                indentStr2 = L"\n" + std::wstring(indent * (level + 1), L' ');
+            }
+
+
+            os << L"[";
+            os << indentStr2;
+
+            scilabVar item = scilab_getListItem(env, var, 0);
+            export_data(env, item, indent, os);
+            for (int i = 1; i < count; ++i)
+            {
+                os << L",";
+                os << indentStr2;
+                item = scilab_getListItem(env, var, i);
+                export_data(env, item, indent, os);
+            }
+
+            os << indentStr;
+            os << L"]";
+            ret = true;
+            break;
+        }
+        case sci_struct: //struct
+        {
+            //check is a struct or hymermatix
+            wchar_t** w;
+            int size = scilab_getFields(env, var, &w);
+
+            //build a vector for C array
+            std::vector<wchar_t*> fields(size);
+            for (int i = 0; i < size; ++i)
+            {
+                fields[i] = w[i];
+            }
+
+            delete[] w;
+
+            int* dims = nullptr;
+            int dim = scilab_getDimArray(env, var, &dims);
+
+            ret = export_struct_array(env, indent, fields, var, os);
+            for(auto f : fields)
+            {
+                FREE(f);
+            }
+
+            break;
+        }
+    }
+
+    --level;
+
+    return ret;
+}
+
+std::string toJSON(scilabEnv env, scilabVar var, int indent)
+{
+    return toJSON((types::InternalType*)var, indent);
+}
+
+std::string toJSON(types::InternalType* it, int indent)
+{
+    std::wostringstream os;
+    scilabVar var = (int*)it;
+
+    bool ret = export_data(nullptr, var, indent, os);
+
+    char* c = wide_string_to_UTF8(os.str().data());
+    std::string s(c);
+    FREE(c);
+    return s;
+}
+
+//
+// fromJSON
+//
+
+std::string json;
+int token_offset = 0;
+
+enum JSONType
+{
+    JSON_UNDEFINED,
+    JSON_EMPTY_MATRIX,
+    JSON_DOUBLE,
+    JSON_BOOL,
+    JSON_STRING,
+    JSON_ARRAY,
+    JSON_STRUCT,
+    JSON_LIST
+};
+
+struct JSONVar {
+    JSONType kind;
+    std::vector<int> dims;
+    bool reduced;
+    char* s1;
+    double d1;
+    int b1;
+    std::vector<std::string> fields;
+    std::unordered_map<std::string, JSONVar*> o1;
+
+    std::vector<char*> s;
+    std::vector<double> d;
+    std::vector<int> b;
+    std::vector<JSONVar*> a;
+    std::unordered_map<std::string, std::vector<JSONVar*>> o;
+
+    JSONVar() : reduced(false)
+    {
+        s1 = nullptr;
+    }
+
+    ~JSONVar()
+    {
+        for (auto c : s)
+        {
+            FREE(c);
+        }
+
+        if(s1)
+        {
+            FREE(s1);
+        }
+
+        for (auto c : a)
+        {
+            delete c;
+        }
+
+        for (auto c : o1)
+        {
+            delete c.second;
+        }
+        // Do not delete content of o
+    }
+};
+
+void getIndexArray(int idx, const std::vector<int>& dims, std::vector<int>& index)
+{
+    int iMul = 1;
+    int size = (int)dims.size();
+    for (int i = 0; i < size; ++i)
+    {
+        index[i] = (int)(idx / iMul) % dims[i];
+        iMul *= dims[i];
+    }
+}
+
+scilabVar createScilabVar(scilabEnv env, const JSONVar* v)
+{
+    scilabVar ret = nullptr;
+    switch (v->kind)
+    {
+        case JSON_EMPTY_MATRIX:
+        {
+            ret = scilab_createEmptyMatrix(env);
+            break;
+        }
+
+        case JSON_DOUBLE:
+        {
+            switch (v->dims.size())
+            {
+                case 0://scalar
+                    ret = scilab_createDouble(env, v->d1);
+                    break;
+
+                case 1: //vector
+                    ret = scilab_createDoubleMatrix2d(env, 1, v->dims[0], 0);
+                    scilab_setDoubleArray(env, ret, v->d.data());
+                    break;
+
+                case 2: //maxtrix
+                    ret = scilab_createDoubleMatrix2d(env, v->dims[0], v->dims[1], 0);
+                    scilab_setDoubleArray(env, ret, v->d.data());
+                    break;
+
+                default: // > 2 dims
+                    ret = scilab_createDoubleMatrix(env, (int)v->dims.size(), v->dims.data(), 0);
+                    scilab_setDoubleArray(env, ret, v->d.data());
+                    break;
+            }
+            break;
+        }
+
+        case JSON_BOOL:
+        {
+            switch (v->dims.size())
+            {
+                case 0://scalar
+
+                    ret = scilab_createBoolean(env, v->b1);
+                    break;
+
+                case 1: //vector
+                    ret = scilab_createBooleanMatrix2d(env, 1, v->dims[0]);
+                    scilab_setBooleanArray(env, ret, v->b.data());
+                    break;
+
+                case 2: //maxtrix
+                    ret = scilab_createBooleanMatrix2d(env, v->dims[0], v->dims[1]);
+                    scilab_setBooleanArray(env, ret, v->b.data());
+                    break;
+
+                default: // > 2 dims
+                    ret = scilab_createBooleanMatrix(env, (int)v->dims.size(), v->dims.data());
+                    scilab_setBooleanArray(env, ret, v->b.data());
+                    break;
+            }
+            break;
+        }
+
+        case JSON_STRING:
+        {
+            int size = 1;
+            std::vector<wchar_t*> w;
+            if (v->dims.size() > 0)
+            {
+                for (auto i : v->dims)
+                {
+                    size *= i;
+                }
+
+                w.resize(size);
+                for (int i = 0; i < size; ++i)
+                {
+                    w[i] = to_wide_string(v->s[i]);
+                }
+            }
+            else
+            {
+                w.push_back(to_wide_string(v->s1));
+            }
+
+
+            switch (v->dims.size())
+            {
+                case 0://scalar
+                {
+                    ret = scilab_createString(env, w[0]);
+                    break;
+                }
+                case 1: //vector
+                {
+                    ret = scilab_createStringMatrix2d(env, 1, v->dims[0]);
+                    scilab_setStringArray(env, ret, w.data());
+                    break;
+                }
+                case 2: //maxtrix
+                {
+                    ret = scilab_createStringMatrix2d(env, v->dims[0], v->dims[1]);
+                    scilab_setStringArray(env, ret, w.data());
+                    break;
+                }
+                default: // > 2 dims
+                {
+                    ret = scilab_createStringMatrix(env, (int)v->dims.size(), v->dims.data());
+                    scilab_setStringArray(env, ret, w.data());
+                    break;
+                }
+            }
+
+            for (auto wc : w)
+            {
+                FREE(wc);
+            }
+
+            break;
+        }
+
+        case JSON_LIST:
+        {
+            int* piAddr = nullptr;
+            int size = (int)v->a.size();
+            ret = scilab_createList(env);
+
+            for (int i = 0; i < size; ++i)
+            {
+                scilabVar var = createScilabVar(env, v->a[i]);
+                scilab_setListItem(env, ret, i, var);
+            }
+            break;
+        }
+
+        case JSON_STRUCT:
+        {
+            int fsize = (int)v->fields.size();
+            std::vector<wchar_t*> fields;
+            fields.reserve(fsize);
+            for (auto f : v->fields)
+            {
+                fields.push_back(to_wide_string(f.data()));
+            }
+
+            int size = 1;
+            for (auto i : v->dims)
+            {
+                size *= i;
+            }
+
+            switch (v->dims.size())
+            {
+                case 0:
+                {
+                    ret = scilab_createStruct(env);
+                    for (int i = 0; i < fsize; ++i)
+                    {
+                        scilab_addField(env, ret, fields[i]);
+                        scilabVar var = createScilabVar(env, v->o1.at(v->fields[i]));
+                        scilab_setStructMatrix2dData(env, ret, fields[i], 0, 0, var);
+                    }
+                    break;
+
+                case 1:
+                {
+                    if (v->dims[0] == 1) //single struct [{"toto":42}]
+                    {
+                        ret = scilab_createStruct(env);
+                        for (int i = 0; i < fsize; ++i)
+                        {
+                            scilab_addField(env, ret, fields[i]);
+                            scilabVar var = createScilabVar(env, v->o.at(v->fields[i])[0]);
+                            scilab_setStructMatrix2dData(env, ret, fields[i], 0, 0, var);
+                        }
+                    }
+                    else //row vector [{"toto":1},{"toto":2}]
+                    {
+                        ret = scilab_createStructMatrix2d(env, 1, size);
+                        for (int i = 0; i < fsize; ++i)
+                        {
+                            scilab_addField(env, ret, fields[i]);
+                            for (int x = 0; x < size; ++x)
+                            {
+                                scilabVar var = createScilabVar(env, v->o.at(v->fields[i])[x]);
+                                scilab_setStructMatrix2dData(env, ret, fields[i], 0, x, var);
+                            }
+                        }
+                    }
+
+                    break;
+                }
+
+                default: //2 and more
+                {
+                    ret = scilab_createStructMatrix(env, (int)v->dims.size(), v->dims.data());
+                    for (int i = 0; i < fsize; ++i)
+                    {
+                        scilab_addField(env, ret, fields[i]);
+                        std::vector<int> index(v->dims.size());
+                        for (int x = 0; x < size; ++x)
+                        {
+                            getIndexArray(x, v->dims, index);
+                            scilabVar var = createScilabVar(env, v->o.at(v->fields[i])[x]);
+                            scilab_setStructMatrixData(env, ret, fields[i], index.data(), var);
+                        }
+                    }
+                }
+                }
+            }
+
+            for(auto wc : fields)
+            {
+                FREE(wc);
+            }
+
+            break;
+        }
+
+        default:
+        {
+            return nullptr;
+        }
+    }
+
+    return ret;
+}
+
+JSONVar* getJSONVar(const jsmntok_t& t)
+{
+    std::string str(json.substr(t.start, t.end - t.start));
+    if (t.type == JSMN_STRING)
+    {
+        JSONVar* v = new JSONVar();
+        v->kind = JSON_STRING;
+        v->s1 = os_strdup(str.data());
+        return v;
+    }
+
+    if (t.type == JSMN_PRIMITIVE)
+    {
+        if (str == "false" || str == "true")
+        {
+            JSONVar* v = new JSONVar();
+            v->kind = JSON_BOOL;
+            v->b1 = (str == "true" ? 1 : 0);
+            return v;
+        }
+
+        try
+        {
+            double val = std::stod(str);
+            //sciprint("it\'s a double\n");
+            JSONVar* v = new JSONVar();
+            v->kind = JSON_DOUBLE;
+            v->d1 = val;
+            return v;
+        }
+        catch (std::invalid_argument e)
+        {
+            JSONVar* v = new JSONVar();
+            v->kind = JSON_STRING;
+            v->s1 = os_strdup(str.data());
+            return v;
+        }
+    }
+
+    return nullptr;
+}
+
+JSONType getCommonType(JSONVar* v)
+{
+    JSONType ref = v->a[0]->kind;
+
+    for (auto c : v->a)
+    {
+        if (c->kind != ref)
+        {
+            return JSON_UNDEFINED;
+        }
+    }
+
+    return ref;
+}
+
+JSONVar* import_data(const jsmntok_t* t)
+{
+    switch (t[token_offset].type)
+    {
+        case JSMN_PRIMITIVE:
+        case JSMN_STRING:
+        {
+            return getJSONVar(t[token_offset++]);
+        }
+
+        case JSMN_OBJECT:
+        {
+            int size = t[token_offset++].size;
+            JSONVar* v = new JSONVar();
+            v->kind = JSON_STRUCT;
+            v->o1.reserve(size);
+
+            for (int i = 0; i < size; ++i)
+            {
+                JSONVar* s = getJSONVar(t[token_offset++]);
+                std::string key(s->s1);
+                delete s;
+
+                JSONVar* data = import_data(t);
+                v->fields.push_back(key);
+                v->o1[key] = data;
+            }
+
+            return v;
+        }
+
+        case JSMN_ARRAY:
+        {
+            int size = t[token_offset].size;
+            JSONVar* v = new JSONVar();
+            token_offset++;
+            if (size == 0)
+            {
+                //emtpy matrix
+                v->kind = JSON_EMPTY_MATRIX;
+                v->reduced = true;
+                return v;
+            }
+
+            v->kind = JSON_ARRAY;
+            v->a.reserve(size);
+
+            for (int i = 0; i < size; ++i)
+            {
+                v->a.push_back(import_data(t));
+            }
+
+            int type = getCommonType(v);
+
+            // check type !
+            if (type != JSON_UNDEFINED)
+            {
+                //check dims count and dims value
+                std::vector<int> ref = v->a[0]->dims;
+                int totalSize = 1;
+                for (auto i : ref)
+                {
+                    totalSize *= i;
+                }
+
+                for (auto c : v->a)
+                {
+                    std::vector<int> dims = c->dims;
+                    if (ref.size() != dims.size())
+                    {
+                        //reduce failed, return list
+                        v->reduced = true;
+                        v->kind = JSON_LIST;
+                        return v;
+                    }
+
+                    for (int i = 0; i < ref.size(); ++i)
+                    {
+                        if (ref[i] != dims[i])
+                        {
+                            //reduce failed, return list
+                            v->reduced = true;
+                            v->kind = JSON_LIST;
+                            return v;
+                        }
+                    }
+                }
+
+                //same dims, can be concat
+
+                //first concat dims
+                switch (ref.size())
+                {
+                    case 0: //scalar -> vector
+                    {
+                        v->dims.push_back((int)v->a.size());
+                        break;
+                    }
+
+                    case 1:
+                    {
+                        //vector -> matrix
+                        v->dims.resize(2);
+                        v->dims[0] = (int)v->a.size();
+                        v->dims[1] = ref[0];
+                        break;
+                    }
+
+                    default:
+                    {
+                        v->dims = ref;
+                        v->dims.push_back((int)v->a.size());
+                        break;
+                    }
+                }
+
+                //try to reduce
+                switch (type)
+                {
+                    case JSON_DOUBLE:
+                    {
+                        //reduce to double array
+                        switch (v->dims.size())
+                        {
+                            case 1: //to vector
+                            {
+                                v->d.resize(totalSize * v->a.size());
+                                std::transform(v->a.begin(), v->a.end(), v->d.begin(),
+                                    [](JSONVar* val){ return val->d1; });
+                                break;
+                            }
+
+                            case 2: //to matrix
+                            {
+                                v->d.resize(totalSize * v->a.size());
+                                int rows = v->dims[0];
+                                int cols = v->dims[1];
+                                for (int i = 0; i < rows; ++i)
+                                {
+                                    for (int j = 0; j < cols; ++j)
+                                    {
+                                        double val = v->a[i]->d[j];
+                                        v->d[j*rows + i] = val;
+                                    }
+                                }
+                                break;
+                            }
+
+                            default: //to hypermatrix
+                            {
+                                v->d.reserve(totalSize * v->a.size());
+                                for (auto c : v->a)
+                                {
+                                    v->d.insert(v->d.end(), c->d.begin(), c->d.end());
+                                }
+                                break;
+                            }
+                        }
+
+                        v->reduced = true;
+                        v->kind = JSON_DOUBLE;
+
+                        //clear a compoant
+                        for (auto c : v->a)
+                        {
+                            delete c;
+                        }
+
+                        v->a.clear();
+                        break;
+                    }
+                    case JSON_BOOL:
+                    {
+                        //reduce to bool array
+                        switch (v->dims.size())
+                        {
+                            case 1: //to vector
+                            {
+                                v->b.resize(totalSize * v->a.size());
+                                std::transform(v->a.begin(), v->a.end(), v->b.begin(),
+                                    [](JSONVar* val){ return val->b1; });
+                                break;
+                            }
+
+                            case 2: //to matrix
+                            {
+                                v->b.resize(totalSize * v->a.size());
+                                int rows = v->dims[0];
+                                int cols = v->dims[1];
+                                for (int i = 0; i < rows; ++i)
+                                {
+                                    for (int j = 0; j < cols; ++j)
+                                    {
+                                        int val = v->a[i]->b[j];
+                                        v->b[j*rows + i] = val;
+                                    }
+                                }
+                                break;
+                            }
+
+                            default: //to hypermatrix
+                            {
+                                v->b.reserve(totalSize * v->a.size());
+                                for (auto c : v->a)
+                                {
+                                    v->b.insert(v->b.end(), c->b.begin(), c->b.end());
+                                }
+                                break;
+                            }
+                        }
+
+                        v->reduced = true;
+                        v->kind = JSON_BOOL;
+
+                        //clear a compoant
+                        for (auto c : v->a)
+                        {
+                            delete c;
+                        }
+
+                        v->a.clear();
+                        break;
+                    }
+
+                    case JSON_STRING:
+                    {
+                        //reduce to string array
+                        switch (v->dims.size())
+                        {
+                            case 1: //to vector
+                            {
+                                v->s.resize(totalSize * v->a.size());
+                                std::transform(v->a.begin(), v->a.end(), v->s.begin(),
+                                    [](JSONVar* val){ return os_strdup(val->s1); });
+                                break;
+                            }
+
+                            case 2: //to matrix
+                            {
+                                v->s.resize(totalSize * v->a.size());
+                                int rows = v->dims[0];
+                                int cols = v->dims[1];
+                                for (int i = 0; i < rows; ++i)
+                                {
+                                    for (int j = 0; j < cols; ++j)
+                                    {
+                                        char* val = v->a[i]->s[j];
+                                        v->s[j*rows + i] = os_strdup(val);
+                                    }
+                                }
+                                break;
+                            }
+
+                            default: //to hypermatrix
+                            {
+                                v->d.reserve(totalSize * v->a.size());
+
+                                for (auto c : v->a)
+                                {
+                                    for (auto s : c->s)
+                                    {
+                                        v->s.push_back(os_strdup(s));
+                                    }
+                                    //v->b.insert(v->b.end(), c->b.begin(), c->b.end());
+                                }
+
+                                break;
+                            }
+                        }
+
+                        v->reduced = true;
+                        v->kind = JSON_STRING;
+
+                        //clear a compoant
+                        for (auto c : v->a)
+                        {
+                            delete c;
+                        }
+
+                        v->a.clear();
+                        break;
+                    }
+
+                    case JSON_STRUCT:
+                    {
+                        //check field name coherence.
+                        std::vector<std::string> fref;
+
+                        //use first element as reference;
+                        for (auto c : v->a[0]->fields)
+                        {
+                            fref.push_back(c);
+                        }
+
+                        for (int i = 1; i < v->a.size(); ++i)
+                        {
+                            //same field count
+                            if (v->a[i]->fields.size() != fref.size())
+                            {
+                                //reduce failed, return list
+                                v->reduced = true;
+                                v->kind = JSON_LIST;
+                                return v;
+                            }
+
+                            //same fields
+                            for (auto c : v->a[i]->fields)
+                            {
+                                if (std::find(fref.begin(), fref.end(), c) == fref.end())
+                                {
+                                    //reduce failed, return list
+                                    v->reduced = true;
+                                    v->kind = JSON_LIST;
+                                    return v;
+                                }
+                            }
+                        }
+                        //ok same field, go concatenate !
+
+                        //copie each value in data vector of new map.
+                        v->o.reserve(fref.size());
+                        switch (v->dims.size())
+                        {
+                            case 1: //row vector
+                            {
+                                for (auto f : fref)
+                                {
+                                    for (auto d : v->a)
+                                    {
+                                        v->o[f].push_back(d->o1[f]);
+                                    }
+                                }
+                                break;
+                            }
+                            case 2: //matrix
+                            {
+                                for (auto f : fref)
+                                {
+                                    for (int j = 0; j < v->dims[1]; ++j)
+                                    {
+                                        for (int i = 0; i < v->dims[0]; ++i)
+                                        {
+                                            auto d = v->a[i];
+                                            if (d->dims.size() == 0)
+                                            {
+                                                v->o[f].push_back(d->o1[f]);
+                                            }
+                                            else
+                                            {
+                                                v->o[f].push_back(d->o[f][j]);
+                                            }
+                                        }
+                                    }
+                                }
+                                break;
+                            }
+                            default: //hypermat
+                            {
+                                for (auto f : fref)
+                                {
+                                    for (auto d : v->a)
+                                    {
+                                        if (d->dims.size() == 0)
+                                        {
+                                            v->o[f].push_back(d->a[0]->o1[f]);
+                                        }
+                                        else
+                                        {
+                                            v->o[f].insert(v->o[f].end(), d->o[f].begin(), d->o[f].end());
+                                        }
+                                    }
+                                }
+                                break;
+                            }
+                        }
+
+                        v->fields = fref;
+                        v->reduced = true;
+                        v->kind = JSON_STRUCT;
+                        break;
+                    }
+                }
+            }
+            else
+            {
+                //heterogeneous -> list
+                v->kind = JSON_LIST;
+            }
+            return v;
+        }
+
+        default:
+            return nullptr;
+    }
+}
+
+scilabVar fromJSON(scilabEnv env, const std::string& s)
+{
+    return (scilabVar)fromJSON(s);
+}
+
+types::InternalType* fromJSON(const std::string& s)
+{
+    json = s;
+    jsmn_parser p;
+    jsmn_init(&p);
+    int r = jsmn_parse(&p, json.data(), (int)json.size(), nullptr, 0);
+    if (r <= 0) {
+        return nullptr;
+    }
+
+    //reset parser
+    jsmn_init(&p);
+    jsmntok_t *t = new jsmntok_t[r];
+    int r2 = jsmn_parse(&p, json.data(), (int)json.size(), t, r);
+
+    if (r > 1 && t[0].type != JSMN_ARRAY && t[0].type != JSMN_OBJECT)
+    {
+        delete[] t;
+        return nullptr;
+    }
+
+    token_offset = 0;
+    JSONVar* v = import_data(t);
+
+    delete[] t;
+    scilabVar var = createScilabVar(nullptr, v);
+    delete v;
+    if (var == nullptr)
+    {
+        return nullptr;
+    }
+
+    return (types::InternalType*)var;
+}
diff --git a/scilab/modules/webtools/src/cpp/json.hxx b/scilab/modules/webtools/src/cpp/json.hxx
new file mode 100644 (file)
index 0000000..8522a0e
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+*  Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+*  Copyright (C) 2016 - Scilab Enterprises - Antoine ELIAS
+*
+* Copyright (C) 2012 - 2016 - Scilab Enterprises
+*
+*/
+
+#ifndef __JSON_HXX__
+#define __JSON_HXX__
+
+#include "api_scilab.h"
+#include "internal.hxx"
+#include "dynlib_webtools.h"
+
+//api C++
+WEBTOOLS_IMPEXP std::string toJSON(types::InternalType* it, int indent = 0);
+WEBTOOLS_IMPEXP types::InternalType* fromJSON(const std::string& s);
+
+//api C
+WEBTOOLS_IMPEXP std::string toJSON(scilabEnv env, scilabVar var, int indent = 0);
+WEBTOOLS_IMPEXP scilabVar fromJSON(scilabEnv env, const std::string& s);
+
+#endif /* !__JSON_HXX__ */
\ No newline at end of file
diff --git a/scilab/modules/webtools/src/cpp/sciCurl.cpp b/scilab/modules/webtools/src/cpp/sciCurl.cpp
new file mode 100644 (file)
index 0000000..082c831
--- /dev/null
@@ -0,0 +1,177 @@
+/*
+*  Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+*
+* Copyright (C) 2017 - ESI-Group - Cedric Delamarre
+*
+* This file is hereby licensed under the terms of the GNU GPL v2.0,
+* pursuant to article 5.3.4 of the CeCILL v.2.1.
+* This file was originally licensed under the terms of the CeCILL v2.1,
+* and continues to be available under such terms.
+* For more information, see the COPYING file which you should have received
+* along with this program.
+*
+*/
+#include <stdio.h>
+#include "sciCurl.hxx"
+#include "string.hxx"
+#include "json.hxx"
+
+extern "C"
+{
+    #include "getScilabPreference.h"
+    #include "freeArrayOfString.h"
+}
+
+SciCurl* SciCurl::me = nullptr;
+std::string SciCurl::data;
+bool SciCurl::useFile = false;
+
+SciCurl* SciCurl::getInstance(void)
+{
+    if(me == nullptr)
+    {
+        me = new SciCurl();
+    }
+
+    return me;
+}
+
+void SciCurl::destroyInstance(void)
+{
+    if (me)
+    {
+        delete me;
+        me = nullptr;
+    }
+}
+
+SciCurl::SciCurl()
+{
+    curl_global_init(CURL_GLOBAL_ALL);
+}
+
+SciCurl::~SciCurl()
+{
+    curl_global_cleanup();
+}
+
+void SciCurl::getResultAsObject(CURL* curl)
+{
+    curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, SciCurl::write_result);
+    useFile = false;
+}
+
+void SciCurl::getResultAsFile(CURL* curl, FILE* fd)
+{
+#ifdef _MSC_VER
+    curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, SciCurl::write_result);
+    curl_easy_setopt(curl, CURLOPT_WRITEDATA, fd);
+    useFile = true;
+#else
+    curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, NULL);
+    curl_easy_setopt(curl, CURLOPT_WRITEDATA, fd);
+#endif
+}
+
+types::InternalType* SciCurl::getResult()
+{
+    types::InternalType* res = fromJSON(data);
+    if (res == nullptr)
+    {
+        res = new types::String(data.c_str());
+    }
+
+    clear();
+
+    return res;
+}
+
+void SciCurl::clear()
+{
+    data.clear();
+}
+
+int SciCurl::write_result(char* pcInput, size_t size, size_t nmemb, void* output)
+{
+#ifdef _MSC_VER
+    if(useFile)
+    {
+        FILE* fd = (FILE*)output;
+        fwrite(pcInput, size, nmemb, fd);
+        return static_cast<int>(size*nmemb);
+    }
+#endif
+
+    std::string d(pcInput, size * nmemb);
+    data += d;
+    return static_cast<int>(size*nmemb);
+}
+
+// Proxy is configured in scilab preferences (internet tab)
+int SciCurl::setProxy(CURL* curl)
+{
+    char* proxyUserPwd = NULL;
+    const char* attrs[] = {"enabled", "host", "port", "user", "password"};
+    const unsigned int N = sizeof(attrs) / sizeof(char*);
+    char** values = getPrefAttributesValues("//web/body/proxy", attrs, N);
+
+    if (values == NULL)
+    {
+        // no proxy configured
+        return 0;
+    }
+
+    // proxy is configured and not enabled
+    if (stricmp(values[0]/*enabled*/, "false") == 0)
+    {
+        freeArrayOfString(values, N);
+        return 0;
+    }
+
+    const unsigned int host_len = (const unsigned int)strlen(values[1]);
+    const unsigned int port_len = (const unsigned int)strlen(values[2]);
+    const unsigned int user_len = (const unsigned int)strlen(values[3]);
+    const unsigned int pwd_len  = (const unsigned int)strlen(values[4]);
+
+    if(host_len == 0 || port_len == 0 || user_len == 0)
+    {
+        return 1;
+    }
+
+    if (pwd_len == 0)
+    {
+        proxyUserPwd = values[3]; //user
+    }
+    else
+    {
+        proxyUserPwd = (char *)MALLOC((user_len + 1 + pwd_len + 1) * sizeof(char));
+        sprintf(proxyUserPwd, "%s:%s", values[3]/*user*/, values[4]/*password*/);
+        proxyUserPwd[user_len + 1 + pwd_len] = '\0';
+    }
+
+    // set cURL options
+    if(curl_easy_setopt(curl, CURLOPT_PROXY, values[1]) != CURLE_OK) //host
+    {
+        FREE(proxyUserPwd);
+        freeArrayOfString(values, N);
+        return 1;
+    }
+
+    if(curl_easy_setopt(curl, CURLOPT_PROXYPORT, strtol(values[2], NULL, 10)) != CURLE_OK) //port
+    {
+        FREE(proxyUserPwd);
+        freeArrayOfString(values, N);
+        return 1;
+    }
+
+    if(curl_easy_setopt(curl, CURLOPT_PROXYUSERPWD, proxyUserPwd) != CURLE_OK) //port
+    {
+        FREE(proxyUserPwd);
+        freeArrayOfString(values, N);
+        return 1;
+    }
+
+    FREE(proxyUserPwd);
+    freeArrayOfString(values, N);
+    return 0;
+}
diff --git a/scilab/modules/webtools/src/cpp/sciCurl.hxx b/scilab/modules/webtools/src/cpp/sciCurl.hxx
new file mode 100644 (file)
index 0000000..9d9be1e
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+ *  Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ *
+ *  Copyright (C) 2017 - ESI-Group - Cedric DELAMARRE
+ *
+ * This file is hereby licensed under the terms of the GNU GPL v2.0,
+ * pursuant to article 5.3.4 of the CeCILL v.2.1.
+ * This file was originally licensed under the terms of the CeCILL v2.1,
+ * and continues to be available under such terms.
+ * For more information, see the COPYING file which you should have received
+ * along with this program.
+ *
+ */
+
+#ifndef __SCICURL_HXX__
+#define __SCICURL_HXX__
+
+#include <curl/curl.h>
+#include <sys/stat.h>
+
+#include "internal.hxx"
+
+extern "C"
+{
+#include "dynlib_webtools.h"
+}
+
+class WEBTOOLS_IMPEXP SciCurl
+{
+public:
+    static SciCurl* getInstance(void);
+    static void destroyInstance(void);
+
+    void getResultAsObject(CURL* curl);
+    void getResultAsFile(CURL* curl, FILE* fd);
+    int setProxy(CURL* curl);
+
+    types::InternalType* getResult(void);
+    void clear(void);
+
+    static int write_result(char* pcInput, size_t size, size_t nmemb, void* output);
+
+private:
+    SciCurl();
+    ~SciCurl();
+
+    static SciCurl* me;
+    static std::string data;
+    static bool useFile;
+};
+
+#endif /* !__SCICURL_HXX__ */
diff --git a/scilab/modules/webtools/src/cpp/webtools.cpp b/scilab/modules/webtools/src/cpp/webtools.cpp
new file mode 100644 (file)
index 0000000..ba4f967
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+* Copyright (C) 2017 - ESI-Group - Cedric DELAMARRE
+*
+*
+* This file is hereby licensed under the terms of the GNU GPL v2.0,
+* pursuant to article 5.3.4 of the CeCILL v.2.1.
+* This file was originally licensed under the terms of the CeCILL v2.1,
+* and continues to be available under such terms.
+* For more information, see the COPYING file which you should have received
+* along with this program.
+*
+*/
+/*--------------------------------------------------------------------------*/
+#include "sciCurl.hxx"
+
+extern "C"
+{
+    #include "webtools.h"
+}
+
+// functions call at library loading
+int Initialize_Webtools(void)
+{
+    return 0;
+}
+
+// functions call at library closing
+int Finalize_Webtools(void)
+{
+    SciCurl::destroyInstance();
+    return 0;
+}
diff --git a/scilab/modules/webtools/tests/unit_tests/jsonplaceholder.dia.ref b/scilab/modules/webtools/tests/unit_tests/jsonplaceholder.dia.ref
new file mode 100644 (file)
index 0000000..c7bbc53
--- /dev/null
@@ -0,0 +1,49 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2017 - ESI-Group
+//
+//  This file is distributed under the same license as the Scilab package.
+// =============================================================================
+// <-- CLI SHELL MODE -->
+// This test use JSONPlaceholder as a simple fake REST API for testing and prototyping.
+// https://github.com/typicode/jsonplaceholder
+root = "http://jsonplaceholder.typicode.com";
+// HTTP GET
+exp_result.userId = 1;
+exp_result.id = 1;
+exp_result.title = "sunt aut facere repellat provident occaecati excepturi optio reprehenderit";
+exp_result.body = "quia et suscipit\nsuscipit recusandae consequuntur expedita et cum\nreprehenderit molestiae ut ut quas totam\nnostrum rerum est autem sunt rem eveniet architecto";
+assert_checkequal(http_get(root + "/posts/1"), exp_result);
+res = http_get(root + "/posts");
+assert_checkequal(size(res), [1, 100]);
+assert_checkequal(res(50).userId, 5);
+assert_checkequal(res(50).id, 50);
+res = http_get(root + "/posts?userId=1");
+assert_checkequal(size(res), [1 10]);
+assert_checkequal(res(1), exp_result);
+// HTTP POST
+clear exp_result;
+data.userId = 12;
+data.title  = "A title";
+data.body   = "A body";
+exp_result  = data;
+exp_result.id = 101;
+assert_checkequal(http_post(root+"/posts", data), exp_result);
+// HTTP PUT
+clear data;
+data.userId = 12;
+data.title  = "A title";
+data.body   = "A body";
+data.id = 1;
+assert_checkequal(http_put(root+"/posts/1", data), data);
+// HTTP PATCH
+clear data;
+clear exp_result;
+data.title = "New title";
+exp_result.userId = 1;
+exp_result.id = 1;
+exp_result.title = "New title";
+exp_result.body = "quia et suscipit\nsuscipit recusandae consequuntur expedita et cum\nreprehenderit molestiae ut ut quas totam\nnostrum rerum est autem sunt rem eveniet architecto";
+assert_checkequal(http_patch(root+"/posts/1", data), exp_result);
+// HTTP DELETE
+assert_checkequal(http_delete(root+"/posts/1"), fromJSON("{}"));
diff --git a/scilab/modules/webtools/tests/unit_tests/jsonplaceholder.tst b/scilab/modules/webtools/tests/unit_tests/jsonplaceholder.tst
new file mode 100644 (file)
index 0000000..a6e71b1
--- /dev/null
@@ -0,0 +1,60 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2017 - ESI-Group
+//
+//  This file is distributed under the same license as the Scilab package.
+// =============================================================================
+
+// <-- CLI SHELL MODE -->
+
+// This test use JSONPlaceholder as a simple fake REST API for testing and prototyping.
+// https://github.com/typicode/jsonplaceholder
+
+root = "http://jsonplaceholder.typicode.com";
+
+// HTTP GET
+exp_result.userId = 1;
+exp_result.id = 1;
+exp_result.title = "sunt aut facere repellat provident occaecati excepturi optio reprehenderit";
+exp_result.body = "quia et suscipit\nsuscipit recusandae consequuntur expedita et cum\nreprehenderit molestiae ut ut quas totam\nnostrum rerum est autem sunt rem eveniet architecto";
+assert_checkequal(http_get(root + "/posts/1"), exp_result);
+
+res = http_get(root + "/posts");
+assert_checkequal(size(res), [1, 100]);
+assert_checkequal(res(50).userId, 5);
+assert_checkequal(res(50).id, 50);
+
+res = http_get(root + "/posts?userId=1");
+assert_checkequal(size(res), [1 10]);
+assert_checkequal(res(1), exp_result);
+
+// HTTP POST
+clear exp_result;
+data.userId = 12;
+data.title  = "A title";
+data.body   = "A body";
+exp_result  = data;
+exp_result.id = 101;
+assert_checkequal(http_post(root+"/posts", data), exp_result);
+
+// HTTP PUT
+clear data;
+data.userId = 12;
+data.title  = "A title";
+data.body   = "A body";
+data.id = 1;
+assert_checkequal(http_put(root+"/posts/1", data), data);
+
+// HTTP PATCH
+clear data;
+clear exp_result;
+data.title = "New title";
+
+exp_result.userId = 1;
+exp_result.id = 1;
+exp_result.title = "New title";
+exp_result.body = "quia et suscipit\nsuscipit recusandae consequuntur expedita et cum\nreprehenderit molestiae ut ut quas totam\nnostrum rerum est autem sunt rem eveniet architecto";
+assert_checkequal(http_patch(root+"/posts/1", data), exp_result);
+
+// HTTP DELETE
+assert_checkequal(http_delete(root+"/posts/1"), fromJSON("{}"));
diff --git a/scilab/modules/webtools/webtools.filters b/scilab/modules/webtools/webtools.filters
new file mode 100644 (file)
index 0000000..0541a6e
--- /dev/null
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup>
+    <Filter Include="Source Files">
+      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+    </Filter>
+    <Filter Include="Header Files">
+      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
+    </Filter>
+    <Filter Include="Resource Files">
+      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions>
+    </Filter>
+    <Filter Include="localization">
+      <UniqueIdentifier>{8374b26a-fd5d-4b83-823a-bd83826c6341}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="Libraries Dependencies">
+      <UniqueIdentifier>{d6efdcda-26d8-4367-87dc-2a39c3350b4b}</UniqueIdentifier>
+    </Filter>
+  </ItemGroup>
+  <ItemGroup>
+  </ItemGroup>
+</Project>
\ No newline at end of file
diff --git a/scilab/modules/webtools/webtools.iss b/scilab/modules/webtools/webtools.iss
new file mode 100644 (file)
index 0000000..2716e0f
--- /dev/null
@@ -0,0 +1,44 @@
+;
+; Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+; Copyright (C) ESI - 2017 - Antoine ELIAS
+;
+; Copyright (C) 2012 - 2016 - Scilab Enterprises
+;
+; This file is hereby licensed under the terms of the GNU GPL v2.0,
+; pursuant to article 5.3.4 of the CeCILL v.2.1.
+; This file was originally licensed under the terms of the CeCILL v2.1,
+; and continues to be available under such terms.
+; For more information, see the COPYING file which you should have received
+; along with this program.
+;
+;--------------------------------------------------------------------------------------------------------------
+; Inno Setup Script (5.3 and more) for Scilab (UNICODE version required)
+;
+;--------------------------------------------------------------------------------------------------------------
+; sound module
+;--------------------------------------------------------------------------------------------------------------
+;
+#define WEBTOOLS "webtools"
+;
+Source: bin\{#WEBTOOLS}.dll; DestDir: {app}\bin; Components: {#COMPN_SCILAB}
+Source: bin\{#WEBTOOLS}.lib; DestDir: {app}\bin; Components: {#COMPN_SCILAB}
+;
+Source: modules\{#WEBTOOLS}\license.txt; DestDir: {app}\modules\{#WEBTOOLS}; Components: {#COMPN_SCILAB}
+;
+Source: modules\{#WEBTOOLS}\sci_gateway\{#WEBTOOLS}_gateway.xml; DestDir: {app}\modules\{#WEBTOOLS}\sci_gateway; Components: {#COMPN_SCILAB}
+;
+Source: modules\{#WEBTOOLS}\etc\{#WEBTOOLS}.quit; DestDir: {app}\modules\{#WEBTOOLS}\etc; Components: {#COMPN_SCILAB}
+Source: modules\{#WEBTOOLS}\etc\{#WEBTOOLS}.start; DestDir: {app}\modules\{#WEBTOOLS}\etc; Components: {#COMPN_SCILAB}
+;
+Source: modules\{#WEBTOOLS}\macros\buildmacros.sce; DestDir: {app}\modules\{#WEBTOOLS}\macros; Components: {#COMPN_SCILAB}
+Source: modules\{#WEBTOOLS}\macros\buildmacros.bat; DestDir: {app}\modules\{#WEBTOOLS}\macros; Components: {#COMPN_SCILAB}
+Source: modules\{#WEBTOOLS}\macros\cleanmacros.bat; DestDir: {app}\modules\{#WEBTOOLS}\macros; Components: {#COMPN_SCILAB}
+Source: modules\{#WEBTOOLS}\macros\*.sci; DestDir: {app}\modules\{#WEBTOOLS}\macros; Components: {#COMPN_SCILAB}
+Source: modules\{#WEBTOOLS}\macros\*.bin; DestDir: {app}\modules\{#WEBTOOLS}\macros; Components: {#COMPN_SCILAB}
+Source: modules\{#WEBTOOLS}\macros\lib; DestDir: {app}\modules\{#WEBTOOLS}\macros; Components: {#COMPN_SCILAB}
+;
+Source: modules\{#WEBTOOLS}\demos\*.*; DestDir: {app}\modules\{#WEBTOOLS}\demos; Flags: recursesubdirs; Components: {#COMPN_SCILAB}
+;
+Source: modules\{#WEBTOOLS}\tests\*.*; DestDir: {app}\modules\{#WEBTOOLS}\tests; Flags: recursesubdirs; Components: {#COMPN_SCILAB} and {#COMPN_TESTS}
+;
+;--------------------------------------------------------------------------------------------------------------
diff --git a/scilab/modules/webtools/webtools.rc b/scilab/modules/webtools/webtools.rc
new file mode 100644 (file)
index 0000000..6bc7551
--- /dev/null
@@ -0,0 +1,97 @@
+// Microsoft Visual C++ generated resource script.
+//
+
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+//#include "afxres.h"
+#define APSTUDIO_HIDDEN_SYMBOLS
+#include "windows.h"
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// French (France) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRA)
+#ifdef _WIN32
+LANGUAGE LANG_FRENCH, SUBLANG_FRENCH
+#pragma code_page(1252)
+#endif //_WIN32
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE 
+BEGIN
+    "resource.h\0"
+END
+
+3 TEXTINCLUDE 
+BEGIN
+    "\r\n"
+    "\0"
+END
+
+#endif    // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Version
+//
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION 6,0,0,0
+ PRODUCTVERSION 6,0,0,0
+ FILEFLAGSMASK 0x17L
+#ifdef _DEBUG
+ FILEFLAGS 0x1L
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS 0x4L
+ FILETYPE 0x0L
+ FILESUBTYPE 0x0L
+BEGIN
+    BLOCK "StringFileInfo"
+    BEGIN
+        BLOCK "040c04b0"
+        BEGIN
+            VALUE "CompanyName", "Scilab"
+            VALUE "FileDescription", "webtools module"
+            VALUE "FileVersion", "6, 0, 0, 0"
+            VALUE "InternalName", "Webtools"
+            VALUE "LegalCopyright", "Copyright (C) 2017"
+            VALUE "OriginalFilename", "webtools.rc"
+            VALUE "ProductName", " webtools"
+            VALUE "ProductVersion", "6, 0, 0, 0"
+        END
+    END
+    BLOCK "VarFileInfo"
+    BEGIN
+        VALUE "Translation", 0x40c, 1200
+    END
+END
+
+#endif    // French (France) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+
+
+/////////////////////////////////////////////////////////////////////////////
+#endif    // not APSTUDIO_INVOKED
+
diff --git a/scilab/modules/webtools/webtools.vcxproj b/scilab/modules/webtools/webtools.vcxproj
new file mode 100644 (file)
index 0000000..fb8aa17
--- /dev/null
@@ -0,0 +1,255 @@
+<?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="Debug|Win32">
+      <Configuration>Debug</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Debug|x64">
+      <Configuration>Debug</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|Win32">
+      <Configuration>Release</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|x64">
+      <Configuration>Release</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{8DBF9BA7-ABB8-4C35-A82A-0ADBEB7E5331}</ProjectGuid>
+    <RootNamespace>webtools</RootNamespace>
+    <Keyword>Win32Proj</Keyword>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <CharacterSet>MultiByte</CharacterSet>
+    <WholeProgramOptimization>false</WholeProgramOptimization>
+    <PlatformToolset>v120</PlatformToolset>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <CharacterSet>MultiByte</CharacterSet>
+    <PlatformToolset>v120</PlatformToolset>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <CharacterSet>MultiByte</CharacterSet>
+    <WholeProgramOptimization>false</WholeProgramOptimization>
+    <PlatformToolset>v120</PlatformToolset>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <CharacterSet>MultiByte</CharacterSet>
+    <PlatformToolset>v120</PlatformToolset>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="ExtensionSettings">
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|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)'=='Debug|Win32'">$(SolutionDir)bin\</OutDir>
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)$(Configuration)\</IntDir>
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</LinkIncremental>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)bin\</OutDir>
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectDir)$(Configuration)\</IntDir>
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</LinkIncremental>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)bin\</OutDir>
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)$(Configuration)\</IntDir>
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)bin\</OutDir>
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectDir)$(Configuration)\</IntDir>
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
+  </PropertyGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <ClCompile>
+      <Optimization>Disabled</Optimization>
+      <AdditionalIncludeDirectories>./includes;./src/c;./src/cpp;../../libs/intl;../../libs/curl/include;../ast/includes/exps;../ast/includes/types;../ast/includes/ast;../ast/includes/system_env;../ast/includes/operations;../api_scilab/includes;../localization/includes;../core/includes;../string/includes;../dynamic_link/includes;../output_stream/includes;../fileio/includes;../preferences/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>FORDLL;_DEBUG;_WINDOWS;_USRDLL;WEBTOOLS_EXPORTS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+      <WarningLevel>Level3</WarningLevel>
+    </ClCompile>
+    <PreLinkEvent>
+      <Message>Make dependencies</Message>
+      <Command>
+      </Command>
+    </PreLinkEvent>
+    <Link>
+      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
+      <OutputFile>$(SolutionDir)bin\$(ProjectName).dll</OutputFile>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <SubSystem>Windows</SubSystem>
+      <ImportLibrary>$(SolutionDir)bin\$(ProjectName).lib</ImportLibrary>
+      <TargetMachine>MachineX86</TargetMachine>
+      <CLRUnmanagedCodeCheck>true</CLRUnmanagedCodeCheck>
+      <RandomizedBaseAddress>false</RandomizedBaseAddress>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <Midl>
+      <TargetEnvironment>X64</TargetEnvironment>
+    </Midl>
+    <ClCompile>
+      <Optimization>Disabled</Optimization>
+      <AdditionalIncludeDirectories>./includes;./src/c;./src/cpp;../../libs/intl;../../libs/curl/include;../ast/includes/exps;../ast/includes/types;../ast/includes/ast;../ast/includes/system_env;../ast/includes/operations;../api_scilab/includes;../localization/includes;../core/includes;../string/includes;../dynamic_link/includes;../output_stream/includes;../fileio/includes;../preferences/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>FORDLL;_DEBUG;_WINDOWS;_USRDLL;WEBTOOLS_EXPORTS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+      <WarningLevel>Level3</WarningLevel>
+    </ClCompile>
+    <PreLinkEvent>
+      <Message>Make dependencies</Message>
+      <Command>
+      </Command>
+    </PreLinkEvent>
+    <Link>
+      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
+      <OutputFile>$(SolutionDir)bin\$(ProjectName).dll</OutputFile>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <SubSystem>Windows</SubSystem>
+      <ImportLibrary>$(SolutionDir)bin\$(ProjectName).lib</ImportLibrary>
+      <TargetMachine>MachineX64</TargetMachine>
+      <CLRUnmanagedCodeCheck>true</CLRUnmanagedCodeCheck>
+      <RandomizedBaseAddress>false</RandomizedBaseAddress>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <ClCompile>
+      <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+      <WholeProgramOptimization>false</WholeProgramOptimization>
+      <AdditionalIncludeDirectories>./includes;./src/c;./src/cpp;../../libs/intl;../../libs/curl/include;../ast/includes/exps;../ast/includes/types;../ast/includes/ast;../ast/includes/system_env;../ast/includes/operations;../api_scilab/includes;../localization/includes;../core/includes;../string/includes;../dynamic_link/includes;../output_stream/includes;../fileio/includes;../preferences/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>FORDLL;NDEBUG;_WINDOWS;_USRDLL;WEBTOOLS_EXPORTS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <StringPooling>true</StringPooling>
+      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <WarningLevel>Level3</WarningLevel>
+      <MultiProcessorCompilation>true</MultiProcessorCompilation>
+    </ClCompile>
+    <PreLinkEvent>
+      <Message>Make dependencies</Message>
+      <Command>
+      </Command>
+    </PreLinkEvent>
+    <Link>
+      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
+      <OutputFile>$(SolutionDir)bin\$(ProjectName).dll</OutputFile>
+      <GenerateDebugInformation>false</GenerateDebugInformation>
+      <SubSystem>Windows</SubSystem>
+      <OptimizeReferences>true</OptimizeReferences>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <ImportLibrary>$(SolutionDir)bin\$(ProjectName).lib</ImportLibrary>
+      <TargetMachine>MachineX86</TargetMachine>
+      <CLRUnmanagedCodeCheck>true</CLRUnmanagedCodeCheck>
+      <RandomizedBaseAddress>false</RandomizedBaseAddress>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <Midl>
+      <TargetEnvironment>X64</TargetEnvironment>
+    </Midl>
+    <ClCompile>
+      <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+      <WholeProgramOptimization>false</WholeProgramOptimization>
+      <AdditionalIncludeDirectories>./includes;./src/c;./src/cpp;../../libs/intl;../../libs/curl/include;../ast/includes/exps;../ast/includes/types;../ast/includes/ast;../ast/includes/system_env;../ast/includes/operations;../api_scilab/includes;../localization/includes;../core/includes;../string/includes;../dynamic_link/includes;../output_stream/includes;../fileio/includes;../preferences/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>FORDLL;NDEBUG;_WINDOWS;_USRDLL;WEBTOOLS_EXPORTS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <StringPooling>true</StringPooling>
+      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <WarningLevel>Level3</WarningLevel>
+      <MultiProcessorCompilation>true</MultiProcessorCompilation>
+    </ClCompile>
+    <PreLinkEvent>
+      <Message>Make dependencies</Message>
+      <Command>
+      </Command>
+    </PreLinkEvent>
+    <Link>
+      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
+      <OutputFile>$(SolutionDir)bin\$(ProjectName).dll</OutputFile>
+      <GenerateDebugInformation>false</GenerateDebugInformation>
+      <SubSystem>Windows</SubSystem>
+      <OptimizeReferences>true</OptimizeReferences>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <ImportLibrary>$(SolutionDir)bin\$(ProjectName).lib</ImportLibrary>
+      <TargetMachine>MachineX64</TargetMachine>
+      <CLRUnmanagedCodeCheck>true</CLRUnmanagedCodeCheck>
+      <RandomizedBaseAddress>false</RandomizedBaseAddress>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemGroup>
+    <ClInclude Include="includes\dynlib_webtools.h" />
+    <ClInclude Include="includes\gw_webtools.h" />
+    <ClInclude Include="includes\webtools.h" />
+    <ClInclude Include="includes\webtools_gw.hxx" />
+    <ClInclude Include="src\cpp\json.hxx" />
+    <ClInclude Include="src\cpp\sciCurl.hxx" />
+    <ClInclude Include="src\c\jsmn.h" />
+  </ItemGroup>
+  <ItemGroup>
+    <ResourceCompile Include="webtools.rc" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="sci_gateway\cpp\checkCommonOpt.cpp" />
+    <ClCompile Include="sci_gateway\cpp\sci_http_delete.cpp" />
+    <ClCompile Include="sci_gateway\cpp\sci_fromJSON.cpp" />
+    <ClCompile Include="sci_gateway\cpp\sci_http_get.cpp" />
+    <ClCompile Include="sci_gateway\cpp\sci_http_patch.cpp" />
+    <ClCompile Include="sci_gateway\cpp\sci_http_post.cpp" />
+    <ClCompile Include="sci_gateway\cpp\sci_http_put.cpp" />
+    <ClCompile Include="sci_gateway\cpp\sci_http_put_post.cpp" />
+    <ClCompile Include="sci_gateway\cpp\sci_toJSON.cpp" />
+    <ClCompile Include="sci_gateway\cpp\sci_http_upload.cpp" />
+    <ClCompile Include="src\cpp\json.cpp" />
+    <ClCompile Include="src\cpp\sciCurl.cpp" />
+    <ClCompile Include="src\cpp\webtools.cpp" />
+    <ClCompile Include="src\c\DllmainWebtools.c" />
+    <ClCompile Include="src\c\jsmn.c" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\api_scilab\api_scilab.vcxproj">
+      <Project>{43c5bab1-1dca-4743-a183-77e0d42fe7d0}</Project>
+    </ProjectReference>
+    <ProjectReference Include="..\ast\ast.vcxproj">
+      <Project>{0d3fa25b-8116-44ec-a45e-260789daa3d9}</Project>
+    </ProjectReference>
+    <ProjectReference Include="..\core\src\c\core.vcxproj">
+      <Project>{c6e2bc17-34d8-46e4-85f3-6293cb21adcd}</Project>
+    </ProjectReference>
+    <ProjectReference Include="..\fileio\fileio.vcxproj">
+      <Project>{4fc72d4a-80ee-4b1a-8724-0201c1a35621}</Project>
+    </ProjectReference>
+    <ProjectReference Include="..\localization\src\localization.vcxproj">
+      <Project>{ecffeb0c-1eda-45ee-9a10-b18143852e17}</Project>
+    </ProjectReference>
+    <ProjectReference Include="..\output_stream\src\c\output_stream.vcxproj">
+      <Project>{a5911cd7-f8e8-440c-a23e-4843a0636f3a}</Project>
+    </ProjectReference>
+    <ProjectReference Include="..\preferences\src\c\preferences.vcxproj">
+      <Project>{7b893e9f-d032-44de-9b71-197a29c4989b}</Project>
+    </ProjectReference>
+    <ProjectReference Include="..\string\src\c\string.vcxproj">
+      <Project>{8d45767a-9b03-4905-97f6-d2f3f79141ea}</Project>
+    </ProjectReference>
+  </ItemGroup>
+  <ItemGroup>
+    <Xml Include="sci_gateway\webtools_gateway.xml" />
+  </ItemGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>
\ No newline at end of file
diff --git a/scilab/modules/webtools/webtools.vcxproj.filters b/scilab/modules/webtools/webtools.vcxproj.filters
new file mode 100644 (file)
index 0000000..5dfe14c
--- /dev/null
@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup>
+    <Filter Include="Header Files">
+      <UniqueIdentifier>{4a748da8-f1a0-427b-83f3-71d3b7b58e19}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="Source Files">
+      <UniqueIdentifier>{b6cfb68d-acb0-4504-bfcd-e3ff600d00d0}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="Resource Files">
+      <UniqueIdentifier>{e0bc1a3e-eff0-4d06-85ab-228653dc7a23}</UniqueIdentifier>
+    </Filter>
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="includes\dynlib_webtools.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="includes\webtools.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="includes\webtools_gw.hxx">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="src\cpp\json.hxx">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="src\cpp\sciCurl.hxx">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="src\c\jsmn.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="includes\gw_webtools.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+  </ItemGroup>
+  <ItemGroup>
+    <ResourceCompile Include="webtools.rc">
+      <Filter>Resource Files</Filter>
+    </ResourceCompile>
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="src\cpp\json.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="src\cpp\sciCurl.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="src\cpp\webtools.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="src\c\DllmainWebtools.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="src\c\jsmn.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="sci_gateway\cpp\sci_http_delete.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="sci_gateway\cpp\sci_http_get.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="sci_gateway\cpp\sci_http_post.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="sci_gateway\cpp\sci_http_put.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="sci_gateway\cpp\sci_http_put_post.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="sci_gateway\cpp\sci_http_upload.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="sci_gateway\cpp\sci_fromJSON.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="sci_gateway\cpp\sci_toJSON.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="sci_gateway\cpp\checkCommonOpt.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="sci_gateway\cpp\sci_http_patch.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+  </ItemGroup>
+  <ItemGroup>
+    <Xml Include="sci_gateway\webtools_gateway.xml" />
+  </ItemGroup>
+</Project>
\ No newline at end of file