Re-plug external_objects + external_objects_java. 34/15934/6
Vincent COUVERT [Wed, 11 Feb 2015 09:39:27 +0000 (10:39 +0100)]
Change-Id: I56e171419c07baae1164abbacff64716a65ea5c8

70 files changed:
scilab/etc/modules.xml.in
scilab/etc/modules.xml.vc
scilab/etc/scilab.start
scilab/modules/api_scilab/src/cpp/api_poly.cpp
scilab/modules/ast/src/cpp/operations/types_multiplication.cpp
scilab/modules/ast/src/cpp/types/function.cpp
scilab/modules/external_objects/Makefile.am
scilab/modules/external_objects/Makefile.in
scilab/modules/external_objects/etc/external_objects.start
scilab/modules/external_objects/external_objects.iss
scilab/modules/external_objects/external_objects.vcxproj
scilab/modules/external_objects/external_objects.vcxproj.filters
scilab/modules/external_objects/includes/ScilabObjects.hxx
scilab/modules/external_objects/includes/gw_external_objects.h
scilab/modules/external_objects/macros/#_deff_wrapper.sci [moved from scilab/modules/external_objects/macros/!_deff_wrapper.sci with 63% similarity]
scilab/modules/external_objects/macros/%_EVoid_p.sci
scilab/modules/external_objects/sci_gateway/cpp/sci_doubleExclam_invoke_.cpp
scilab/modules/external_objects/sci_gateway/cpp/sci_percent_EObj_e.cpp
scilab/modules/external_objects/sci_gateway/external_objects_gateway.xml
scilab/modules/external_objects/src/cpp/EOType.cpp [new file with mode: 0644]
scilab/modules/external_objects/src/cpp/EOType.hxx [new file with mode: 0644]
scilab/modules/external_objects/src/cpp/ScilabObjects.cpp
scilab/modules/external_objects/src/cpp/addNamedVariable.cpp
scilab/modules/external_objects/src/cpp/addToClasspath.cpp
scilab/modules/external_objects/src/cpp/array.cpp
scilab/modules/external_objects/src/cpp/cast.cpp
scilab/modules/external_objects/src/cpp/classExtract.cpp
scilab/modules/external_objects/src/cpp/compile.cpp
scilab/modules/external_objects/src/cpp/deff.cpp
scilab/modules/external_objects/src/cpp/doubleExclam_invoke.cpp
scilab/modules/external_objects/src/cpp/evalString.cpp
scilab/modules/external_objects/src/cpp/exists.cpp
scilab/modules/external_objects/src/cpp/getClassName.cpp
scilab/modules/external_objects/src/cpp/getEnvironmentName.cpp
scilab/modules/external_objects/src/cpp/getField.cpp
scilab/modules/external_objects/src/cpp/getFields.cpp
scilab/modules/external_objects/src/cpp/getNamedVariable.cpp
scilab/modules/external_objects/src/cpp/import.cpp
scilab/modules/external_objects/src/cpp/invoke.cpp
scilab/modules/external_objects/src/cpp/invoke_asref.cpp
scilab/modules/external_objects/src/cpp/invoke_lu.cpp
scilab/modules/external_objects/src/cpp/invoker.cpp
scilab/modules/external_objects/src/cpp/newInstance.cpp
scilab/modules/external_objects/src/cpp/objectExtract.cpp
scilab/modules/external_objects/src/cpp/objectInsert.cpp
scilab/modules/external_objects/src/cpp/objectPrint.cpp
scilab/modules/external_objects/src/cpp/operation.cpp
scilab/modules/external_objects/src/cpp/setField.cpp
scilab/modules/external_objects/src/cpp/trace.cpp
scilab/modules/external_objects/src/cpp/unwrap.cpp
scilab/modules/external_objects/src/cpp/unwrapremove.cpp
scilab/modules/external_objects/src/cpp/wrap.cpp
scilab/modules/external_objects/src/cpp/wrapAsRef.cpp
scilab/modules/external_objects_java/etc/external_objects_java.start
scilab/modules/external_objects_java/sci_gateway/external_objects_java_gateway.xml
scilab/modules/external_objects_java/src/cpp/ScilabJavaEnvironmentWrapper.cpp
scilab/modules/external_objects_java/src/java/org/scilab/modules/external_objects_java/ScilabJavaCompiler.java
scilab/modules/external_objects_java/tests/unit_tests/jdeff.dia.ref
scilab/modules/external_objects_java/tests/unit_tests/jdeff.tst
scilab/modules/external_objects_java/tests/unit_tests/jexists.dia.ref
scilab/modules/external_objects_java/tests/unit_tests/jexists.tst
scilab/modules/external_objects_java/tests/unit_tests/junwrap.dia.ref
scilab/modules/external_objects_java/tests/unit_tests/junwrap.tst
scilab/modules/external_objects_java/tests/unit_tests/jwrap.dia.ref
scilab/modules/external_objects_java/tests/unit_tests/jwrap.tst
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/jvm/sci_gateway/cpp/jvm_gw.cpp
scilab/tools/innosetup/code_modules.iss

index bb64757..90b117c 100644 (file)
@@ -87,7 +87,7 @@
 <module name="history_browser" activate="@JAVA_ENABLE@"/>
 <module name="preferences" activate="@GUI_ENABLE@"/>
 <module name="xml" activate="yes"/>
-<module name="external_objects" activate="no"/>
+<module name="external_objects" activate="yes"/>
 <module name="ast" activate="yes"/>
-<module name="external_objects_java" activate="no"/>
+<module name="external_objects_java" activate="@JAVA_ENABLE@"/>
 </modules>
index ff8d434..192bb26 100644 (file)
@@ -84,8 +84,8 @@
     <module name="history_browser" activate="yes"/>
     <module name="preferences" activate="yes"/>
     <module name="xml" activate="yes"/>
-    <module name="external_objects" activate="no"/>
+    <module name="external_objects" activate="yes"/>
     <module name="ast" activate="yes"/>
-    <module name="external_objects_java" activate="no"/>
+    <module name="external_objects_java" activate="yes"/>
     <module name="mpi" activate="no"/>
 </modules>
index 8da91a4..6cdf47d 100644 (file)
@@ -45,6 +45,19 @@ if ((getscilabmode() == "NWNI" | getscilabmode() == "NW") & sciargs()<>"-nb")
    clear v opts;
 end
 
+// loads modules ======================================================
+modules    = getmodules();
+for i=1:size(modules,"*")
+  startFile = "SCI/modules/" + modules(i) + "/etc/" + modules(i) + ".start";
+  ierr=exec(startFile, 'errcatch', -1);
+  if ierr <> 0 then
+     disp(msprintf(gettext("Failed to execute %s:"),startFile));
+     disp(lasterror());
+     exit(2);
+   end
+end
+clear modules i load ierr startFile;
+
 // Create some configuration variables ================================
 home = getenv("HOME", SCI);
 if getos() <> "Windows" then
index 9c518e1..4a68ff6 100644 (file)
@@ -68,6 +68,7 @@ SciErr getPolyVariableName(void* _pvCtx, int* _piAddress, char* _pstVarName, int
     char* pstTemp = wide_string_to_UTF8(((InternalType*)_piAddress)->getAs<types::Polynom>()->getVariableName().c_str());
     strcpy(_pstVarName, pstTemp);
     FREE(pstTemp);
+    *_piVarNameLen = static_cast<int>(strlen(_pstVarName));
     return sciErr;
 }
 
index e26cf2b..8d496c5 100644 (file)
@@ -70,7 +70,7 @@ InternalType *GenericTimes(InternalType *_pLeftOperand, InternalType *_pRightOpe
     /*
     ** DOUBLE * POLY
     */
-    else if (TypeL == InternalType::ScilabDouble && TypeR == InternalType::ScilabPolynom)
+    else if (TypeL == InternalType::ScilabDouble && (TypeR == InternalType::ScilabPolynom || TypeR == InternalType::ScilabDollar))
     {
         Double *pL   = _pLeftOperand->getAs<Double>();
         Polynom *pR     = _pRightOperand->getAs<types::Polynom>();
@@ -87,7 +87,7 @@ InternalType *GenericTimes(InternalType *_pLeftOperand, InternalType *_pRightOpe
     /*
     ** POLY * DOUBLE
     */
-    else if (TypeL == InternalType::ScilabPolynom && TypeR == InternalType::ScilabDouble)
+    else if ((TypeL == InternalType::ScilabPolynom || TypeL == InternalType::ScilabDollar) && TypeR == InternalType::ScilabDouble)
     {
         Polynom *pL          = _pLeftOperand->getAs<types::Polynom>();
         Double *pR              = _pRightOperand->getAs<Double>();
index df48d36..d719f6f 100644 (file)
@@ -229,44 +229,53 @@ Function::ReturnValue WrapFunction::call(typed_list &in, optional_list &opt, int
     }
     else
     {
-        for (std::size_t i(0); i != (size_t)_iRetCount && outOrder[i] != -1 && outOrder[i] != 0 ; ++i)
+        if (_iRetCount == 1 && outOrder[0] == -1)
         {
-            if (outOrder[i] - 1 < gStr.m_iIn)
-            {
-                std::size_t const iPos(outOrder[i] - 1);
-                //protect variable to deletion
-                inCopy[iPos]->IncreaseRef();
-                if (inCopy[iPos]->isDouble() && ((types::Double*)inCopy[iPos])->isViewAsInteger())
-                {
-                    types::Double* pD = inCopy[iPos]->getAs<types::Double>();
-                    pD->convertFromInteger();
-                }
-
-                if (inCopy[iPos]->isDouble() && ((types::Double*)inCopy[iPos])->isViewAsZComplex())
-                {
-                    types::Double* pD = inCopy[iPos]->getAs<types::Double>();
-                    pD->convertFromZComplex();
-                }
-
-                out.push_back(inCopy[iPos]);
-            }
-            else
+            //special case gateways that just call PutLhsVar()
+            //without LhsVar or createEmptyMatrix to return []
+            out.push_back(Double::Empty());
+        }
+        else
+        {
+            for (std::size_t i(0); i != (size_t)_iRetCount && outOrder[i] != -1 && outOrder[i] != 0; ++i)
             {
-                std::size_t const iPos(outOrder[i] - gStr.m_iIn - 1);
-                if (tmpOut[iPos]->isDouble() && ((types::Double*)tmpOut[iPos])->isViewAsInteger())
+                if (outOrder[i] - 1 < gStr.m_iIn)
                 {
-                    types::Double* pD = tmpOut[iPos]->getAs<types::Double>();
-                    pD->convertFromInteger();
+                    std::size_t const iPos(outOrder[i] - 1);
+                    //protect variable to deletion
+                    inCopy[iPos]->IncreaseRef();
+                    if (inCopy[iPos]->isDouble() && ((types::Double*)inCopy[iPos])->isViewAsInteger())
+                    {
+                        types::Double* pD = inCopy[iPos]->getAs<types::Double>();
+                        pD->convertFromInteger();
+                    }
+
+                    if (inCopy[iPos]->isDouble() && ((types::Double*)inCopy[iPos])->isViewAsZComplex())
+                    {
+                        types::Double* pD = inCopy[iPos]->getAs<types::Double>();
+                        pD->convertFromZComplex();
+                    }
+
+                    out.push_back(inCopy[iPos]);
                 }
-
-                if (tmpOut[iPos]->isDouble() && ((types::Double*)tmpOut[iPos])->isViewAsZComplex())
+                else
                 {
-                    types::Double* pD = tmpOut[iPos]->getAs<types::Double>();
-                    pD->convertFromZComplex();
+                    std::size_t const iPos(outOrder[i] - gStr.m_iIn - 1);
+                    if (tmpOut[iPos]->isDouble() && ((types::Double*)tmpOut[iPos])->isViewAsInteger())
+                    {
+                        types::Double* pD = tmpOut[iPos]->getAs<types::Double>();
+                        pD->convertFromInteger();
+                    }
+
+                    if (tmpOut[iPos]->isDouble() && ((types::Double*)tmpOut[iPos])->isViewAsZComplex())
+                    {
+                        types::Double* pD = tmpOut[iPos]->getAs<types::Double>();
+                        pD->convertFromZComplex();
+                    }
+
+                    out.push_back(tmpOut[iPos]);
+                    tmpOut[iPos] = 0;
                 }
-
-                out.push_back(tmpOut[iPos]);
-                tmpOut[iPos] = 0;
             }
         }
     }
index a1b3c36..157a343 100644 (file)
@@ -77,7 +77,8 @@ EXTERNAL_OBJECTS_CPP_SOURCES = \
     src/cpp/ScilabOptionsSetter.cpp \
     src/cpp/ScilabAutoCleaner.cpp \
     src/cpp/ExternalObjectsFunction.cpp \
-    src/cpp/wrapInFloat.cpp
+    src/cpp/wrapInFloat.cpp \
+    src/cpp/EOType.cpp
 
 GATEWAY_C_SOURCES = sci_gateway/c/gw_external_objects.c
 
@@ -139,7 +140,11 @@ libsciexternal_objects_la_CPPFLAGS = \
     -I$(top_srcdir)/modules/output_stream/includes \
     -I$(top_srcdir)/modules/string/includes \
     -I$(top_srcdir)/modules/fileio/includes \
-    -I$(top_srcdir)/modules/core/src/c
+    -I$(top_srcdir)/modules/core/src/c \
+    -I$(top_srcdir)/modules/dynamic_link/includes \
+    -I$(top_srcdir)/modules/threads/includes \
+    -I$(top_srcdir)/modules/console/includes \
+    $(EIGEN_CPPFLAGS)
 
 
 pkglib_LTLIBRARIES = libsciexternal_objects.la 
index 1aede13..ba2d264 100644 (file)
@@ -221,7 +221,8 @@ am__objects_2 =  \
        src/cpp/libsciexternal_objects_algo_la-ScilabOptionsSetter.lo \
        src/cpp/libsciexternal_objects_algo_la-ScilabAutoCleaner.lo \
        src/cpp/libsciexternal_objects_algo_la-ExternalObjectsFunction.lo \
-       src/cpp/libsciexternal_objects_algo_la-wrapInFloat.lo
+       src/cpp/libsciexternal_objects_algo_la-wrapInFloat.lo \
+       src/cpp/libsciexternal_objects_algo_la-EOType.lo
 am_libsciexternal_objects_algo_la_OBJECTS = $(am__objects_1) \
        $(am__objects_1) $(am__objects_2)
 libsciexternal_objects_algo_la_OBJECTS =  \
@@ -779,7 +780,8 @@ EXTERNAL_OBJECTS_CPP_SOURCES = \
     src/cpp/ScilabOptionsSetter.cpp \
     src/cpp/ScilabAutoCleaner.cpp \
     src/cpp/ExternalObjectsFunction.cpp \
-    src/cpp/wrapInFloat.cpp
+    src/cpp/wrapInFloat.cpp \
+    src/cpp/EOType.cpp
 
 GATEWAY_C_SOURCES = sci_gateway/c/gw_external_objects.c
 GATEWAY_CPP_SOURCES = \
@@ -839,7 +841,11 @@ libsciexternal_objects_la_CPPFLAGS = \
     -I$(top_srcdir)/modules/output_stream/includes \
     -I$(top_srcdir)/modules/string/includes \
     -I$(top_srcdir)/modules/fileio/includes \
-    -I$(top_srcdir)/modules/core/src/c
+    -I$(top_srcdir)/modules/core/src/c \
+    -I$(top_srcdir)/modules/dynamic_link/includes \
+    -I$(top_srcdir)/modules/threads/includes \
+    -I$(top_srcdir)/modules/console/includes \
+    $(EIGEN_CPPFLAGS)
 
 pkglib_LTLIBRARIES = libsciexternal_objects.la 
 noinst_LTLIBRARIES = libsciexternal_objects-algo.la 
@@ -1058,6 +1064,8 @@ src/cpp/libsciexternal_objects_algo_la-ExternalObjectsFunction.lo:  \
        src/cpp/$(am__dirstamp) src/cpp/$(DEPDIR)/$(am__dirstamp)
 src/cpp/libsciexternal_objects_algo_la-wrapInFloat.lo:  \
        src/cpp/$(am__dirstamp) src/cpp/$(DEPDIR)/$(am__dirstamp)
+src/cpp/libsciexternal_objects_algo_la-EOType.lo:  \
+       src/cpp/$(am__dirstamp) src/cpp/$(DEPDIR)/$(am__dirstamp)
 
 libsciexternal_objects-algo.la: $(libsciexternal_objects_algo_la_OBJECTS) $(libsciexternal_objects_algo_la_DEPENDENCIES) $(EXTRA_libsciexternal_objects_algo_la_DEPENDENCIES) 
        $(AM_V_CXXLD)$(CXXLINK)  $(libsciexternal_objects_algo_la_OBJECTS) $(libsciexternal_objects_algo_la_LIBADD) $(LIBS)
@@ -1217,6 +1225,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libsciexternal_objects_la-sci_percent_EObj_y_foo.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libsciexternal_objects_la-sci_percent_EObj_z_foo.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libsciexternal_objects_la-sci_percent_foo_i_EObj.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/cpp/$(DEPDIR)/libsciexternal_objects_algo_la-EOType.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/cpp/$(DEPDIR)/libsciexternal_objects_algo_la-ExternalObjectsFunction.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/cpp/$(DEPDIR)/libsciexternal_objects_algo_la-OptionsHelper.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/cpp/$(DEPDIR)/libsciexternal_objects_algo_la-ScilabAutoCleaner.Plo@am__quote@
@@ -1649,6 +1658,13 @@ src/cpp/libsciexternal_objects_algo_la-wrapInFloat.lo: src/cpp/wrapInFloat.cpp
 @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) $(libsciexternal_objects_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/cpp/libsciexternal_objects_algo_la-wrapInFloat.lo `test -f 'src/cpp/wrapInFloat.cpp' || echo '$(srcdir)/'`src/cpp/wrapInFloat.cpp
 
+src/cpp/libsciexternal_objects_algo_la-EOType.lo: src/cpp/EOType.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciexternal_objects_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/cpp/libsciexternal_objects_algo_la-EOType.lo -MD -MP -MF src/cpp/$(DEPDIR)/libsciexternal_objects_algo_la-EOType.Tpo -c -o src/cpp/libsciexternal_objects_algo_la-EOType.lo `test -f 'src/cpp/EOType.cpp' || echo '$(srcdir)/'`src/cpp/EOType.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_at)$(am__mv) src/cpp/$(DEPDIR)/libsciexternal_objects_algo_la-EOType.Tpo src/cpp/$(DEPDIR)/libsciexternal_objects_algo_la-EOType.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     $(AM_V_CXX)source='src/cpp/EOType.cpp' object='src/cpp/libsciexternal_objects_algo_la-EOType.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) $(libsciexternal_objects_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/cpp/libsciexternal_objects_algo_la-EOType.lo `test -f 'src/cpp/EOType.cpp' || echo '$(srcdir)/'`src/cpp/EOType.cpp
+
 sci_gateway/cpp/libsciexternal_objects_la-sci_percent_EObj_e.lo: sci_gateway/cpp/sci_percent_EObj_e.cpp
 @am__fastdepCXX_TRUE@  $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciexternal_objects_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT sci_gateway/cpp/libsciexternal_objects_la-sci_percent_EObj_e.lo -MD -MP -MF sci_gateway/cpp/$(DEPDIR)/libsciexternal_objects_la-sci_percent_EObj_e.Tpo -c -o sci_gateway/cpp/libsciexternal_objects_la-sci_percent_EObj_e.lo `test -f 'sci_gateway/cpp/sci_percent_EObj_e.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_percent_EObj_e.cpp
 @am__fastdepCXX_TRUE@  $(AM_V_at)$(am__mv) sci_gateway/cpp/$(DEPDIR)/libsciexternal_objects_la-sci_percent_EObj_e.Tpo sci_gateway/cpp/$(DEPDIR)/libsciexternal_objects_la-sci_percent_EObj_e.Plo
index 450e58e..807c147 100644 (file)
@@ -8,7 +8,7 @@
 // http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
 
 // TODO : make this '71' more dynamic (with a funptr)
-intppty(71);
+intppty("/external_objects");
 evoid = mlist(["_EVoid", "_EnvId", "_id"], int32(0), int32(0));
 enull = mlist(["_EObj", "_EnvId", "_id"], int32(0), int32(0));
 load("SCI/modules/external_objects/macros/lib");
\ No newline at end of file
index cc3e2d3..c0a5d87 100644 (file)
@@ -31,7 +31,7 @@ Source: modules\{#EXTERNAL_OBJECTS}\etc\{#EXTERNAL_OBJECTS}.start; DestDir: {app
 Source: modules\{#EXTERNAL_OBJECTS}\macros\buildmacros.sce; DestDir: {app}\modules\{#EXTERNAL_OBJECTS}\macros; Components: {#COMPN_SCILAB}
 Source: modules\{#EXTERNAL_OBJECTS}\macros\buildmacros.bat; DestDir: {app}\modules\{#EXTERNAL_OBJECTS}\macros; Components: {#COMPN_SCILAB}
 Source: modules\{#EXTERNAL_OBJECTS}\macros\cleanmacros.bat; DestDir: {app}\modules\{#EXTERNAL_OBJECTS}\macros; Components: {#COMPN_SCILAB}
-;Source: modules\{#EXTERNAL_OBJECTS}\macros\*.bin; DestDir: {app}\modules\{#EXTERNAL_OBJECTS}\macros; Components: {#COMPN_SCILAB}
+Source: modules\{#EXTERNAL_OBJECTS}\macros\*.bin; DestDir: {app}\modules\{#EXTERNAL_OBJECTS}\macros; Components: {#COMPN_SCILAB}
 Source: modules\{#EXTERNAL_OBJECTS}\macros\*.sci; DestDir: {app}\modules\{#EXTERNAL_OBJECTS}\macros; Components: {#COMPN_SCILAB}
 ;Source: modules\{#EXTERNAL_OBJECTS}\macros\lib; DestDir: {app}\modules\{#EXTERNAL_OBJECTS}\macros; Components: {#COMPN_SCILAB}
 ;Source: modules\{#EXTERNAL_OBJECTS}\macros\names; DestDir: {app}\modules\{#EXTERNAL_OBJECTS}\macros; Components: {#COMPN_SCILAB}
index c1fa199..fec7766 100644 (file)
@@ -80,7 +80,7 @@
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>includes;../../libs/intl;../localization/includes;../output_stream/includes;../core/includes;../api_scilab/includes;../fileio/includes;../ast/includes/operations;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>includes;../../libs/intl;../../libs/Eigen/includes;../localization/includes;../output_stream/includes;../core/includes;../api_scilab/includes;../fileio/includes;../ast/includes/types;../ast/includes/ast;../ast/includes/analysis;../ast/includes/exps;../ast/includes/operations;../ast/includes/symbol;../ast/includes/system_env;../dynamic_link/includes;../string/includes;../threads/includes;../console/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>FORDLL;_DEBUG;_WINDOWS;_USRDLL;EXTERNAL_OBJECTS_SCILAB_EXPORTS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
       <WarningLevel>Level3</WarningLevel>
@@ -107,7 +107,7 @@ lib /DEF:"$(ProjectDir)core_f_import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform
     </Midl>
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>includes;../../libs/intl;../localization/includes;../output_stream/includes;../core/includes;../api_scilab/includes;../fileio/includes;../ast/includes/operations;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>includes;../../libs/intl;../../libs/Eigen/includes;../localization/includes;../output_stream/includes;../core/includes;../api_scilab/includes;../fileio/includes;../ast/includes/types;../ast/includes/ast;../ast/includes/analysis;../ast/includes/exps;../ast/includes/operations;../ast/includes/symbol;../ast/includes/system_env;../dynamic_link/includes;../string/includes;../threads/includes;../console/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>FORDLL;_DEBUG;_WINDOWS;_USRDLL;EXTERNAL_OBJECTS_SCILAB_EXPORTS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
       <WarningLevel>Level3</WarningLevel>
@@ -132,7 +132,7 @@ lib /DEF:"$(ProjectDir)core_f_import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform
     <ClCompile>
       <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
       <WholeProgramOptimization>false</WholeProgramOptimization>
-      <AdditionalIncludeDirectories>includes;../../libs/intl;../localization/includes;../output_stream/includes;../core/includes;../api_scilab/includes;../fileio/includes;../ast/includes/operations;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>includes;../../libs/intl;../../libs/Eigen/includes;../localization/includes;../output_stream/includes;../core/includes;../api_scilab/includes;../fileio/includes;../ast/includes/types;../ast/includes/ast;../ast/includes/analysis;../ast/includes/exps;../ast/includes/operations;../ast/includes/symbol;../ast/includes/system_env;../dynamic_link/includes;../string/includes;../threads/includes;../console/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>FORDLL;NDEBUG;_WINDOWS;_USRDLL;EXTERNAL_OBJECTS_SCILAB_EXPORTS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
@@ -165,7 +165,7 @@ lib /DEF:"$(ProjectDir)core_f_import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform
     <ClCompile>
       <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
       <WholeProgramOptimization>false</WholeProgramOptimization>
-      <AdditionalIncludeDirectories>includes;../../libs/intl;../localization/includes;../output_stream/includes;../core/includes;../api_scilab/includes;../fileio/includes;../ast/includes/operations;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>includes;../../libs/intl;../../libs/Eigen/includes;../localization/includes;../output_stream/includes;../core/includes;../api_scilab/includes;../fileio/includes;../ast/includes/types;../ast/includes/ast;../ast/includes/analysis;../ast/includes/exps;../ast/includes/operations;../ast/includes/symbol;../ast/includes/system_env;../dynamic_link/includes;../string/includes;../threads/includes;../console/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>FORDLL;NDEBUG;_WINDOWS;_USRDLL;EXTERNAL_OBJECTS_SCILAB_EXPORTS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
@@ -210,6 +210,7 @@ lib /DEF:"$(ProjectDir)core_f_import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform
     <ClInclude Include="includes\ScilabObjects.hxx" />
     <ClInclude Include="includes\ScilabOptionsSetter.hxx" />
     <ClInclude Include="includes\ScilabStream.hxx" />
+    <ClInclude Include="src\cpp\EOType.hxx" />
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="sci_gateway\cpp\sci_doubleExclam_invoke_.cpp" />
@@ -254,6 +255,7 @@ lib /DEF:"$(ProjectDir)core_f_import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform
     <ClCompile Include="src\cpp\deff.cpp" />
     <ClCompile Include="src\cpp\display.cpp" />
     <ClCompile Include="src\cpp\doubleExclam_invoke.cpp" />
+    <ClCompile Include="src\cpp\EOType.cpp" />
     <ClCompile Include="src\cpp\evalString.cpp" />
     <ClCompile Include="src\cpp\exists.cpp" />
     <ClCompile Include="src\cpp\ExternalObjectsFunction.cpp" />
@@ -296,6 +298,9 @@ lib /DEF:"$(ProjectDir)core_f_import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform
     <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="..\fileio\fileio.vcxproj">
       <Project>{4fc72d4a-80ee-4b1a-8724-0201c1a35621}</Project>
     </ProjectReference>
@@ -317,6 +322,9 @@ lib /DEF:"$(ProjectDir)core_f_import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform
   <ItemGroup>
     <ResourceCompile Include="external_objects.rc" />
   </ItemGroup>
+  <ItemGroup>
+    <Xml Include="sci_gateway\external_objects_gateway.xml" />
+  </ItemGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
   </ImportGroup>
index 3c3ef49..0a2fd7c 100644 (file)
@@ -72,6 +72,9 @@
     <ClInclude Include="includes\ScilabStream.hxx">
       <Filter>Header Files</Filter>
     </ClInclude>
+    <ClInclude Include="src\cpp\EOType.hxx">
+      <Filter>Header Files</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="sci_gateway\c\gw_external_objects.c">
     <ClCompile Include="src\cpp\invoke_asref.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
+    <ClCompile Include="src\cpp\EOType.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <Library Include="..\..\bin\libintl.lib" />
       <Filter>Resource File</Filter>
     </ResourceCompile>
   </ItemGroup>
+  <ItemGroup>
+    <Xml Include="sci_gateway\external_objects_gateway.xml" />
+  </ItemGroup>
 </Project>
\ No newline at end of file
index 1c0a7c8..f617da4 100644 (file)
@@ -34,9 +34,8 @@ class EXTERNAL_OBJECTS_SCILAB_IMPEXP ScilabObjects
     static const char * _EOBJ[];
     static const char * _ECLASS[];
     static const char * _EVOID[];
-    static const char * _INVOKE_;
-
 public:
+    static const wchar_t * _INVOKE_;
 
     static void initialization(ScilabAbstractEnvironment & env, void * pvApiCtx);
 
@@ -44,7 +43,7 @@ public:
 
     static void createEnvironmentObjectAtPos(int type, int pos, int id, const int envId, void * pvApiCtx);
 
-    static void copyInvocationMacroToStack(int pos, ScilabAbstractEnvironment & env, void * pvApiCtx);
+    static void copyInvocationMacroToStack(int pos, const int envId, bool isNew, void * pvApiCtx);
 
     static void removeTemporaryVars(const int envId, int * tmpvar);
 
index a4343a2..a60c4f4 100644 (file)
 EXTERNAL_OBJECTS_SCILAB_IMPEXP int gw_external_objects(void);
 
 /*--------------------------------------------------------------------------*/
-int sci_percent_EObj_e(char * fname, void* pvApiCtx);
-int sci_percent_EObj_p(char * fname, void* pvApiCtx);
-int sci_percent_EClass_e(char * fname, void* pvApiCtx);
-int sci_percent_foo_i_EObj(char * fname, void* pvApiCtx);
-int sci_percent_EObj_a_foo(char * fname, void* pvApiCtx);
-int sci_percent_EObj_d_foo(char * fname, void* pvApiCtx);
-int sci_percent_EObj_g_foo(char * fname, void* pvApiCtx);
-int sci_percent_EObj_h_foo(char * fname, void* pvApiCtx);
-int sci_percent_EObj_j_foo(char * fname, void* pvApiCtx);
-int sci_percent_EObj_k_foo(char * fname, void* pvApiCtx);
-int sci_percent_EObj_l_foo(char * fname, void* pvApiCtx);
-int sci_percent_EObj_m_foo(char * fname, void* pvApiCtx);
-int sci_percent_EObj_n_foo(char * fname, void* pvApiCtx);
-int sci_percent_EObj_o_foo(char * fname, void* pvApiCtx);
-int sci_percent_EObj_p_foo(char * fname, void* pvApiCtx);
-int sci_percent_EObj_q_foo(char * fname, void* pvApiCtx);
-int sci_percent_EObj_r_foo(char * fname, void* pvApiCtx);
-int sci_percent_EObj_s_foo(char * fname, void* pvApiCtx);
-int sci_percent_EObj_t_foo(char * fname, void* pvApiCtx);
-int sci_percent_EObj_x_foo(char * fname, void* pvApiCtx);
-int sci_percent_EObj_y_foo(char * fname, void* pvApiCtx);
-int sci_percent_EObj_z_foo(char * fname, void* pvApiCtx);
-int sci_percent_EObj_1_foo(char * fname, void* pvApiCtx);
-int sci_percent_EObj_2_foo(char * fname, void* pvApiCtx);
-int sci_percent_EObj_3_foo(char * fname, void* pvApiCtx);
-int sci_percent_EObj_4_foo(char * fname, void* pvApiCtx);
-int sci_percent_EObj_0(char * fname, void* pvApiCtx);
-int sci_percent_EObj_5(char * fname, void* pvApiCtx);
-int sci_percent_EObj_t(char * fname, void* pvApiCtx);
-int sci_invoke_lu(char * fname, void* pvApiCtx);
-int sci_doubleExclam_invoke_(char * fname, void* pvApiCtx);
-int sci_percent_EObj_disp(char * fname, void* pvApiCtx);
+EXTERNAL_OBJECTS_SCILAB_IMPEXP int sci_percent_EObj_e(char * fname, void* pvApiCtx);
+EXTERNAL_OBJECTS_SCILAB_IMPEXP int sci_percent_EObj_p(char * fname, void* pvApiCtx);
+EXTERNAL_OBJECTS_SCILAB_IMPEXP int sci_percent_EClass_e(char * fname, void* pvApiCtx);
+EXTERNAL_OBJECTS_SCILAB_IMPEXP int sci_percent_foo_i_EObj(char * fname, void* pvApiCtx);
+EXTERNAL_OBJECTS_SCILAB_IMPEXP int sci_percent_EObj_a_foo(char * fname, void* pvApiCtx);
+EXTERNAL_OBJECTS_SCILAB_IMPEXP int sci_percent_EObj_d_foo(char * fname, void* pvApiCtx);
+EXTERNAL_OBJECTS_SCILAB_IMPEXP int sci_percent_EObj_g_foo(char * fname, void* pvApiCtx);
+EXTERNAL_OBJECTS_SCILAB_IMPEXP int sci_percent_EObj_h_foo(char * fname, void* pvApiCtx);
+EXTERNAL_OBJECTS_SCILAB_IMPEXP int sci_percent_EObj_j_foo(char * fname, void* pvApiCtx);
+EXTERNAL_OBJECTS_SCILAB_IMPEXP int sci_percent_EObj_k_foo(char * fname, void* pvApiCtx);
+EXTERNAL_OBJECTS_SCILAB_IMPEXP int sci_percent_EObj_l_foo(char * fname, void* pvApiCtx);
+EXTERNAL_OBJECTS_SCILAB_IMPEXP int sci_percent_EObj_m_foo(char * fname, void* pvApiCtx);
+EXTERNAL_OBJECTS_SCILAB_IMPEXP int sci_percent_EObj_n_foo(char * fname, void* pvApiCtx);
+EXTERNAL_OBJECTS_SCILAB_IMPEXP int sci_percent_EObj_o_foo(char * fname, void* pvApiCtx);
+EXTERNAL_OBJECTS_SCILAB_IMPEXP int sci_percent_EObj_p_foo(char * fname, void* pvApiCtx);
+EXTERNAL_OBJECTS_SCILAB_IMPEXP int sci_percent_EObj_q_foo(char * fname, void* pvApiCtx);
+EXTERNAL_OBJECTS_SCILAB_IMPEXP int sci_percent_EObj_r_foo(char * fname, void* pvApiCtx);
+EXTERNAL_OBJECTS_SCILAB_IMPEXP int sci_percent_EObj_s_foo(char * fname, void* pvApiCtx);
+EXTERNAL_OBJECTS_SCILAB_IMPEXP int sci_percent_EObj_t_foo(char * fname, void* pvApiCtx);
+EXTERNAL_OBJECTS_SCILAB_IMPEXP int sci_percent_EObj_x_foo(char * fname, void* pvApiCtx);
+EXTERNAL_OBJECTS_SCILAB_IMPEXP int sci_percent_EObj_y_foo(char * fname, void* pvApiCtx);
+EXTERNAL_OBJECTS_SCILAB_IMPEXP int sci_percent_EObj_z_foo(char * fname, void* pvApiCtx);
+EXTERNAL_OBJECTS_SCILAB_IMPEXP int sci_percent_EObj_1_foo(char * fname, void* pvApiCtx);
+EXTERNAL_OBJECTS_SCILAB_IMPEXP int sci_percent_EObj_2_foo(char * fname, void* pvApiCtx);
+EXTERNAL_OBJECTS_SCILAB_IMPEXP int sci_percent_EObj_3_foo(char * fname, void* pvApiCtx);
+EXTERNAL_OBJECTS_SCILAB_IMPEXP int sci_percent_EObj_4_foo(char * fname, void* pvApiCtx);
+EXTERNAL_OBJECTS_SCILAB_IMPEXP int sci_percent_EObj_0(char * fname, void* pvApiCtx);
+EXTERNAL_OBJECTS_SCILAB_IMPEXP int sci_percent_EObj_5(char * fname, void* pvApiCtx);
+EXTERNAL_OBJECTS_SCILAB_IMPEXP int sci_percent_EObj_t(char * fname, void* pvApiCtx);
+EXTERNAL_OBJECTS_SCILAB_IMPEXP int sci_invoke_lu(char * fname, void* pvApiCtx);
+EXTERNAL_OBJECTS_SCILAB_IMPEXP int sci_doubleExclam_invoke_(char * fname, void* pvApiCtx);
+EXTERNAL_OBJECTS_SCILAB_IMPEXP int sci_percent_EObj_disp(char * fname, void* pvApiCtx);
 /*--------------------------------------------------------------------------*/
 #endif /* __GW_EXTERNAL_OBJECTS_H__ */
 /*--------------------------------------------------------------------------*/
@@ -1,4 +1,4 @@
-function !_deff_wrapper(name, definition, code)
+function #_deff_wrapper(name, definition, code)
     deff(definition, code);
     execstr(name + "=resume(" + name + ")");
 endfunction
index 1147c3f..850d9e5 100644 (file)
@@ -9,5 +9,5 @@
 //
 
 function %_EVoid_p(x)
-    write(%io(2), "External Objects: void wrapper")
+    printf("External Objects: void wrapper\n")
 endfunction
\ No newline at end of file
index 27adec4..51ef1bb 100644 (file)
@@ -13,6 +13,7 @@
 #include "ScilabGateway.hxx"
 
 extern "C" {
+#include "api_scilab.h"
 #include "Scierror.h"
 #include "gw_external_objects.h"
 }
@@ -23,7 +24,20 @@ int sci_doubleExclam_invoke_(char * fname, void* pvApiCtx)
 {
     try
     {
-        return ScilabGateway::doubleExclam_invoke(fname, 0, pvApiCtx);
+        int* addr = NULL;
+        double dbl = 0;
+        SciErr sciErr = getVarAddressFromPosition(pvApiCtx, Rhs, &addr);
+        if (sciErr.iErr)
+        {
+            throw ScilabAbstractEnvironmentException(__LINE__, __FILE__, gettext("Invalid variable: cannot retrieve the data"));
+        }
+
+        if (getScalarDouble(pvApiCtx, addr, &dbl))
+        {
+            throw ScilabAbstractEnvironmentException(__LINE__, __FILE__, gettext("Invalid variable: cannot retrieve the data"));
+        }
+
+        return ScilabGateway::doubleExclam_invoke(fname, static_cast<int>(dbl), pvApiCtx);
     }
     catch (std::exception & e)
     {
index 7c284c5..c5a5af0 100644 (file)
@@ -15,6 +15,7 @@
 extern "C" {
 #include "Scierror.h"
 #include "gw_external_objects.h"
+#include "sciprint.h"
 }
 
 using namespace org_modules_external_objects;
index 8639994..db25b53 100644 (file)
 <?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE GATEWAY SYSTEM "../../functions/xml/gateway.dtd">
+<!DOCTYPE module SYSTEM "../../functions/xml/gateway.dtd">
 <!--
-* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-* 
-* This file must be used under the terms of the CeCILL.
-* This source file is licensed as described in the file COPYING, which
-* you should have received as part of this distribution.  The terms
-* are also available at    
-* http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
-*
--->
-<GATEWAY name="external_objects">
-    <!--
+/* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution.  The terms
+ * are also available at    
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ */
 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.
 
-gatewayId is the position in the hashtable 'Interfaces' defined in the file SCI/modules/core/src/c/callinterf.h
-
-primitiveId is the position in the hashtable '<module>Table Tab[]' defined in the file modules/<module>/sci_gateway/c/gw_<module>.c
-
-primitiveName is the name of the Scilab function
-
 Don't touch if you do not know what you are doing
-
 -->
-    <PRIMITIVE gatewayId="71" primitiveId="1" primitiveName="%_EObj_e"/>
-    <PRIMITIVE gatewayId="71" primitiveId="2" primitiveName="%_EObj_6"/>
-    <PRIMITIVE gatewayId="71" primitiveId="3" primitiveName="%_EClass_6"/>
-    <PRIMITIVE gatewayId="71" primitiveId="4" primitiveName="%_EObj_p"/>
-    <PRIMITIVE gatewayId="71" primitiveId="5" primitiveName="%_EClass_e"/>
-    <PRIMITIVE gatewayId="71" primitiveId="6" primitiveName="%_EClass_p"/>
-    <PRIMITIVE gatewayId="71" primitiveId="7" primitiveName="%c_i__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="8" primitiveName="%s_i__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="9" primitiveName="%b_i__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="10" primitiveName="%i_i__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="11" primitiveName="%l_i__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="12" primitiveName="%_EObj_i__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="13" primitiveName="%_EObj_a_c"/>
-    <PRIMITIVE gatewayId="71" primitiveId="14" primitiveName="%_EObj_a_s"/>
-    <PRIMITIVE gatewayId="71" primitiveId="15" primitiveName="%_EObj_a_b"/>
-    <PRIMITIVE gatewayId="71" primitiveId="16" primitiveName="%_EObj_a_i"/>
-    <PRIMITIVE gatewayId="71" primitiveId="17" primitiveName="%_EObj_a__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="18" primitiveName="%c_a__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="19" primitiveName="%s_a__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="20" primitiveName="%b_a__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="21" primitiveName="%i_a__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="22" primitiveName="%_EObj_d_c"/>
-    <PRIMITIVE gatewayId="71" primitiveId="23" primitiveName="%_EObj_d_s"/>
-    <PRIMITIVE gatewayId="71" primitiveId="24" primitiveName="%_EObj_d_b"/>
-    <PRIMITIVE gatewayId="71" primitiveId="25" primitiveName="%_EObj_d_i"/>
-    <PRIMITIVE gatewayId="71" primitiveId="26" primitiveName="%_EObj_d__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="27" primitiveName="%c_d__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="28" primitiveName="%s_d__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="29" primitiveName="%b_d__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="30" primitiveName="%i_d__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="31" primitiveName="%_EObj_g_c"/>
-    <PRIMITIVE gatewayId="71" primitiveId="32" primitiveName="%_EObj_g_s"/>
-    <PRIMITIVE gatewayId="71" primitiveId="33" primitiveName="%_EObj_g_b"/>
-    <PRIMITIVE gatewayId="71" primitiveId="34" primitiveName="%_EObj_g_i"/>
-    <PRIMITIVE gatewayId="71" primitiveId="35" primitiveName="%_EObj_g__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="36" primitiveName="%c_g__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="37" primitiveName="%s_g__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="38" primitiveName="%b_g__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="39" primitiveName="%i_g__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="40" primitiveName="%_EObj_h_c"/>
-    <PRIMITIVE gatewayId="71" primitiveId="41" primitiveName="%_EObj_h_s"/>
-    <PRIMITIVE gatewayId="71" primitiveId="42" primitiveName="%_EObj_h_b"/>
-    <PRIMITIVE gatewayId="71" primitiveId="43" primitiveName="%_EObj_h_i"/>
-    <PRIMITIVE gatewayId="71" primitiveId="44" primitiveName="%_EObj_h__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="45" primitiveName="%c_h__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="46" primitiveName="%s_h__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="47" primitiveName="%b_h__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="48" primitiveName="%i_h__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="49" primitiveName="%_EObj_j_c"/>
-    <PRIMITIVE gatewayId="71" primitiveId="50" primitiveName="%_EObj_j_s"/>
-    <PRIMITIVE gatewayId="71" primitiveId="51" primitiveName="%_EObj_j_b"/>
-    <PRIMITIVE gatewayId="71" primitiveId="52" primitiveName="%_EObj_j_i"/>
-    <PRIMITIVE gatewayId="71" primitiveId="53" primitiveName="%_EObj_j__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="54" primitiveName="%c_j__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="55" primitiveName="%s_j__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="56" primitiveName="%b_j__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="57" primitiveName="%i_j__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="58" primitiveName="%_EObj_k_c"/>
-    <PRIMITIVE gatewayId="71" primitiveId="59" primitiveName="%_EObj_k_s"/>
-    <PRIMITIVE gatewayId="71" primitiveId="60" primitiveName="%_EObj_k_b"/>
-    <PRIMITIVE gatewayId="71" primitiveId="61" primitiveName="%_EObj_k_i"/>
-    <PRIMITIVE gatewayId="71" primitiveId="62" primitiveName="%_EObj_k__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="63" primitiveName="%c_k__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="64" primitiveName="%s_k__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="65" primitiveName="%b_k__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="66" primitiveName="%i_k__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="67" primitiveName="%_EObj_l_c"/>
-    <PRIMITIVE gatewayId="71" primitiveId="68" primitiveName="%_EObj_l_s"/>
-    <PRIMITIVE gatewayId="71" primitiveId="69" primitiveName="%_EObj_l_b"/>
-    <PRIMITIVE gatewayId="71" primitiveId="70" primitiveName="%_EObj_l_i"/>
-    <PRIMITIVE gatewayId="71" primitiveId="71" primitiveName="%_EObj_l__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="72" primitiveName="%c_l__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="73" primitiveName="%s_l__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="74" primitiveName="%b_l__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="75" primitiveName="%i_l__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="76" primitiveName="%_EObj_m_c"/>
-    <PRIMITIVE gatewayId="71" primitiveId="77" primitiveName="%_EObj_m_s"/>
-    <PRIMITIVE gatewayId="71" primitiveId="78" primitiveName="%_EObj_m_b"/>
-    <PRIMITIVE gatewayId="71" primitiveId="79" primitiveName="%_EObj_m_i"/>
-    <PRIMITIVE gatewayId="71" primitiveId="80" primitiveName="%_EObj_m__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="81" primitiveName="%c_m__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="82" primitiveName="%s_m__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="83" primitiveName="%b_m__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="84" primitiveName="%i_m__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="85" primitiveName="%_EObj_n_c"/>
-    <PRIMITIVE gatewayId="71" primitiveId="86" primitiveName="%_EObj_n_s"/>
-    <PRIMITIVE gatewayId="71" primitiveId="87" primitiveName="%_EObj_n_b"/>
-    <PRIMITIVE gatewayId="71" primitiveId="88" primitiveName="%_EObj_n_i"/>
-    <PRIMITIVE gatewayId="71" primitiveId="89" primitiveName="%_EObj_n__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="90" primitiveName="%c_n__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="91" primitiveName="%s_n__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="92" primitiveName="%b_n__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="93" primitiveName="%i_n__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="94" primitiveName="%_EObj_o_c"/>
-    <PRIMITIVE gatewayId="71" primitiveId="95" primitiveName="%_EObj_o_s"/>
-    <PRIMITIVE gatewayId="71" primitiveId="96" primitiveName="%_EObj_o_b"/>
-    <PRIMITIVE gatewayId="71" primitiveId="97" primitiveName="%_EObj_o_i"/>
-    <PRIMITIVE gatewayId="71" primitiveId="98" primitiveName="%_EObj_o__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="99" primitiveName="%c_o__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="100" primitiveName="%s_o__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="101" primitiveName="%b_o__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="102" primitiveName="%i_o__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="103" primitiveName="%_EObj_p_c"/>
-    <PRIMITIVE gatewayId="71" primitiveId="104" primitiveName="%_EObj_p_s"/>
-    <PRIMITIVE gatewayId="71" primitiveId="105" primitiveName="%_EObj_p_b"/>
-    <PRIMITIVE gatewayId="71" primitiveId="106" primitiveName="%_EObj_p_i"/>
-    <PRIMITIVE gatewayId="71" primitiveId="107" primitiveName="%_EObj_p__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="108" primitiveName="%c_p__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="109" primitiveName="%s_p__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="110" primitiveName="%b_p__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="111" primitiveName="%i_p__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="112" primitiveName="%_EObj_q_c"/>
-    <PRIMITIVE gatewayId="71" primitiveId="113" primitiveName="%_EObj_q_s"/>
-    <PRIMITIVE gatewayId="71" primitiveId="114" primitiveName="%_EObj_q_b"/>
-    <PRIMITIVE gatewayId="71" primitiveId="115" primitiveName="%_EObj_q_i"/>
-    <PRIMITIVE gatewayId="71" primitiveId="116" primitiveName="%_EObj_q__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="117" primitiveName="%c_q__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="118" primitiveName="%s_q__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="119" primitiveName="%b_q__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="120" primitiveName="%i_q__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="121" primitiveName="%_EObj_r_c"/>
-    <PRIMITIVE gatewayId="71" primitiveId="122" primitiveName="%_EObj_r_s"/>
-    <PRIMITIVE gatewayId="71" primitiveId="123" primitiveName="%_EObj_r_b"/>
-    <PRIMITIVE gatewayId="71" primitiveId="124" primitiveName="%_EObj_r_i"/>
-    <PRIMITIVE gatewayId="71" primitiveId="125" primitiveName="%_EObj_r__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="126" primitiveName="%c_r__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="127" primitiveName="%s_r__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="128" primitiveName="%b_r__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="129" primitiveName="%i_r__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="130" primitiveName="%_EObj_s_c"/>
-    <PRIMITIVE gatewayId="71" primitiveId="131" primitiveName="%_EObj_s_s"/>
-    <PRIMITIVE gatewayId="71" primitiveId="132" primitiveName="%_EObj_s_b"/>
-    <PRIMITIVE gatewayId="71" primitiveId="133" primitiveName="%_EObj_s_i"/>
-    <PRIMITIVE gatewayId="71" primitiveId="134" primitiveName="%_EObj_s__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="135" primitiveName="%c_s__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="136" primitiveName="%s_s__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="137" primitiveName="%b_s__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="138" primitiveName="%i_s__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="139" primitiveName="%_EObj_x_c"/>
-    <PRIMITIVE gatewayId="71" primitiveId="140" primitiveName="%_EObj_x_s"/>
-    <PRIMITIVE gatewayId="71" primitiveId="141" primitiveName="%_EObj_x_b"/>
-    <PRIMITIVE gatewayId="71" primitiveId="142" primitiveName="%_EObj_x_i"/>
-    <PRIMITIVE gatewayId="71" primitiveId="143" primitiveName="%_EObj_x__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="144" primitiveName="%c_x__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="145" primitiveName="%s_x__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="146" primitiveName="%b_x__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="147" primitiveName="%i_x__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="148" primitiveName="%_EObj_y_c"/>
-    <PRIMITIVE gatewayId="71" primitiveId="149" primitiveName="%_EObj_y_s"/>
-    <PRIMITIVE gatewayId="71" primitiveId="150" primitiveName="%_EObj_y_b"/>
-    <PRIMITIVE gatewayId="71" primitiveId="151" primitiveName="%_EObj_y_i"/>
-    <PRIMITIVE gatewayId="71" primitiveId="152" primitiveName="%_EObj_y__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="153" primitiveName="%c_y__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="154" primitiveName="%s_y__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="155" primitiveName="%b_y__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="156" primitiveName="%i_y__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="157" primitiveName="%_EObj_z_c"/>
-    <PRIMITIVE gatewayId="71" primitiveId="158" primitiveName="%_EObj_z_s"/>
-    <PRIMITIVE gatewayId="71" primitiveId="159" primitiveName="%_EObj_z_b"/>
-    <PRIMITIVE gatewayId="71" primitiveId="160" primitiveName="%_EObj_z_i"/>
-    <PRIMITIVE gatewayId="71" primitiveId="161" primitiveName="%_EObj_z__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="162" primitiveName="%c_z__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="163" primitiveName="%s_z__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="164" primitiveName="%b_z__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="165" primitiveName="%i_z__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="166" primitiveName="%_EObj_1_c"/>
-    <PRIMITIVE gatewayId="71" primitiveId="167" primitiveName="%_EObj_1_s"/>
-    <PRIMITIVE gatewayId="71" primitiveId="168" primitiveName="%_EObj_1_b"/>
-    <PRIMITIVE gatewayId="71" primitiveId="169" primitiveName="%_EObj_1_i"/>
-    <PRIMITIVE gatewayId="71" primitiveId="170" primitiveName="%_EObj_1__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="171" primitiveName="%c_1__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="172" primitiveName="%s_1__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="173" primitiveName="%b_1__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="174" primitiveName="%i_1__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="175" primitiveName="%_EObj_2_c"/>
-    <PRIMITIVE gatewayId="71" primitiveId="176" primitiveName="%_EObj_2_s"/>
-    <PRIMITIVE gatewayId="71" primitiveId="177" primitiveName="%_EObj_2_b"/>
-    <PRIMITIVE gatewayId="71" primitiveId="178" primitiveName="%_EObj_2_i"/>
-    <PRIMITIVE gatewayId="71" primitiveId="179" primitiveName="%_EObj_2__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="180" primitiveName="%c_2__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="181" primitiveName="%s_2__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="182" primitiveName="%b_2__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="183" primitiveName="%i_2__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="184" primitiveName="%_EObj_3_c"/>
-    <PRIMITIVE gatewayId="71" primitiveId="185" primitiveName="%_EObj_3_s"/>
-    <PRIMITIVE gatewayId="71" primitiveId="186" primitiveName="%_EObj_3_b"/>
-    <PRIMITIVE gatewayId="71" primitiveId="187" primitiveName="%_EObj_3_i"/>
-    <PRIMITIVE gatewayId="71" primitiveId="188" primitiveName="%_EObj_3__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="189" primitiveName="%c_3__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="190" primitiveName="%s_3__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="191" primitiveName="%b_3__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="192" primitiveName="%i_3__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="193" primitiveName="%_EObj_4_c"/>
-    <PRIMITIVE gatewayId="71" primitiveId="194" primitiveName="%_EObj_4_s"/>
-    <PRIMITIVE gatewayId="71" primitiveId="195" primitiveName="%_EObj_4_b"/>
-    <PRIMITIVE gatewayId="71" primitiveId="196" primitiveName="%_EObj_4_i"/>
-    <PRIMITIVE gatewayId="71" primitiveId="197" primitiveName="%_EObj_4__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="198" primitiveName="%c_4__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="199" primitiveName="%s_4__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="200" primitiveName="%b_4__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="201" primitiveName="%i_4__EObj"/>
-    <PRIMITIVE gatewayId="71" primitiveId="202" primitiveName="%_EObj_0"/>
-    <PRIMITIVE gatewayId="71" primitiveId="203" primitiveName="%_EObj_5"/>
-    <PRIMITIVE gatewayId="71" primitiveId="204" primitiveName="%_EObj_t"/>
-    <PRIMITIVE gatewayId="71" primitiveId="205" primitiveName="invoke_lu"/>
-    <PRIMITIVE gatewayId="71" primitiveId="206" primitiveName="!!_invoke_"/>
-    <PRIMITIVE gatewayId="71" primitiveId="207" primitiveName="%_EObj_disp"/>
-</GATEWAY>
+<module name="external_objects">
+    <gateway name="sci_percent_EObj_e"       function="%_EObj_e" type="0"/>
+    <gateway name="sci_percent_EObj_e"       function="%_EObj_6" type="0"/>
+    <gateway name="sci_percent_EClass_e"     function="%_EClass_6" type="0"/>
+    <gateway name="sci_percent_EObj_p"       function="%_EObj_p" type="0"/>
+    <gateway name="sci_percent_EClass_e"     function="%_EClass_e" type="0"/>
+    <gateway name="sci_percent_EObj_p"       function="%_EClass_p" type="0"/>
+    <gateway name="sci_percent_foo_i_EObj"   function="%c_i__EObj" type="0"/>
+    <gateway name="sci_percent_foo_i_EObj"   function="%s_i__EObj" type="0"/>
+    <gateway name="sci_percent_foo_i_EObj"   function="%b_i__EObj" type="0"/>
+    <gateway name="sci_percent_foo_i_EObj"   function="%i_i__EObj" type="0"/>
+    <gateway name="sci_percent_foo_i_EObj"   function="%l_i__EObj" type="0"/>
+    <gateway name="sci_percent_foo_i_EObj"   function="%_EObj_i__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_a_foo"   function="%_EObj_a_c" type="0"/>
+    <gateway name="sci_percent_EObj_a_foo"   function="%_EObj_a_s" type="0"/>
+    <gateway name="sci_percent_EObj_a_foo"   function="%_EObj_a_b" type="0"/>
+    <gateway name="sci_percent_EObj_a_foo"   function="%_EObj_a_i" type="0"/>
+    <gateway name="sci_percent_EObj_a_foo"   function="%_EObj_a__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_a_foo"   function="%c_a__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_a_foo"   function="%s_a__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_a_foo"   function="%b_a__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_a_foo"   function="%i_a__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_d_foo"   function="%_EObj_d_c" type="0"/>
+    <gateway name="sci_percent_EObj_d_foo"   function="%_EObj_d_s" type="0"/>
+    <gateway name="sci_percent_EObj_d_foo"   function="%_EObj_d_b" type="0"/>
+    <gateway name="sci_percent_EObj_d_foo"   function="%_EObj_d_i" type="0"/>
+    <gateway name="sci_percent_EObj_d_foo"   function="%_EObj_d__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_d_foo"   function="%c_d__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_d_foo"   function="%s_d__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_d_foo"   function="%b_d__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_d_foo"   function="%i_d__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_g_foo"   function="%_EObj_g_c" type="0"/>
+    <gateway name="sci_percent_EObj_g_foo"   function="%_EObj_g_s" type="0"/>
+    <gateway name="sci_percent_EObj_g_foo"   function="%_EObj_g_b" type="0"/>
+    <gateway name="sci_percent_EObj_g_foo"   function="%_EObj_g_i" type="0"/>
+    <gateway name="sci_percent_EObj_g_foo"   function="%_EObj_g__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_g_foo"   function="%c_g__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_g_foo"   function="%s_g__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_g_foo"   function="%b_g__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_g_foo"   function="%i_g__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_h_foo"   function="%_EObj_h_c" type="0"/>
+    <gateway name="sci_percent_EObj_h_foo"   function="%_EObj_h_s" type="0"/>
+    <gateway name="sci_percent_EObj_h_foo"   function="%_EObj_h_b" type="0"/>
+    <gateway name="sci_percent_EObj_h_foo"   function="%_EObj_h_i" type="0"/>
+    <gateway name="sci_percent_EObj_h_foo"   function="%_EObj_h__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_h_foo"   function="%c_h__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_h_foo"   function="%s_h__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_h_foo"   function="%b_h__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_h_foo"   function="%i_h__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_j_foo"   function="%_EObj_j_c" type="0"/>
+    <gateway name="sci_percent_EObj_j_foo"   function="%_EObj_j_s" type="0"/>
+    <gateway name="sci_percent_EObj_j_foo"   function="%_EObj_j_b" type="0"/>
+    <gateway name="sci_percent_EObj_j_foo"   function="%_EObj_j_i" type="0"/>
+    <gateway name="sci_percent_EObj_j_foo"   function="%_EObj_j__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_j_foo"   function="%c_j__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_j_foo"   function="%s_j__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_j_foo"   function="%b_j__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_j_foo"   function="%i_j__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_k_foo"   function="%_EObj_k_c" type="0"/>
+    <gateway name="sci_percent_EObj_k_foo"   function="%_EObj_k_s" type="0"/>
+    <gateway name="sci_percent_EObj_k_foo"   function="%_EObj_k_b" type="0"/>
+    <gateway name="sci_percent_EObj_k_foo"   function="%_EObj_k_i" type="0"/>
+    <gateway name="sci_percent_EObj_k_foo"   function="%_EObj_k__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_k_foo"   function="%c_k__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_k_foo"   function="%s_k__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_k_foo"   function="%b_k__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_k_foo"   function="%i_k__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_l_foo"   function="%_EObj_l_c" type="0"/>
+    <gateway name="sci_percent_EObj_l_foo"   function="%_EObj_l_s" type="0"/>
+    <gateway name="sci_percent_EObj_l_foo"   function="%_EObj_l_b" type="0"/>
+    <gateway name="sci_percent_EObj_l_foo"   function="%_EObj_l_i" type="0"/>
+    <gateway name="sci_percent_EObj_l_foo"   function="%_EObj_l__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_l_foo"   function="%c_l__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_l_foo"   function="%s_l__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_l_foo"   function="%b_l__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_l_foo"   function="%i_l__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_m_foo"   function="%_EObj_m_c" type="0"/>
+    <gateway name="sci_percent_EObj_m_foo"   function="%_EObj_m_s" type="0"/>
+    <gateway name="sci_percent_EObj_m_foo"   function="%_EObj_m_b" type="0"/>
+    <gateway name="sci_percent_EObj_m_foo"   function="%_EObj_m_i" type="0"/>
+    <gateway name="sci_percent_EObj_m_foo"   function="%_EObj_m__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_m_foo"   function="%c_m__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_m_foo"   function="%s_m__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_m_foo"   function="%b_m__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_m_foo"   function="%i_m__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_n_foo"   function="%_EObj_n_c" type="0"/>
+    <gateway name="sci_percent_EObj_n_foo"   function="%_EObj_n_s" type="0"/>
+    <gateway name="sci_percent_EObj_n_foo"   function="%_EObj_n_b" type="0"/>
+    <gateway name="sci_percent_EObj_n_foo"   function="%_EObj_n_i" type="0"/>
+    <gateway name="sci_percent_EObj_n_foo"   function="%_EObj_n__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_n_foo"   function="%c_n__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_n_foo"   function="%s_n__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_n_foo"   function="%b_n__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_n_foo"   function="%i_n__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_o_foo"   function="%_EObj_o_c" type="0"/>
+    <gateway name="sci_percent_EObj_o_foo"   function="%_EObj_o_s" type="0"/>
+    <gateway name="sci_percent_EObj_o_foo"   function="%_EObj_o_b" type="0"/>
+    <gateway name="sci_percent_EObj_o_foo"   function="%_EObj_o_i" type="0"/>
+    <gateway name="sci_percent_EObj_o_foo"   function="%_EObj_o__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_o_foo"   function="%c_o__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_o_foo"   function="%s_o__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_o_foo"   function="%b_o__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_o_foo"   function="%i_o__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_p_foo"   function="%_EObj_p_c" type="0"/>
+    <gateway name="sci_percent_EObj_p_foo"   function="%_EObj_p_s" type="0"/>
+    <gateway name="sci_percent_EObj_p_foo"   function="%_EObj_p_b" type="0"/>
+    <gateway name="sci_percent_EObj_p_foo"   function="%_EObj_p_i" type="0"/>
+    <gateway name="sci_percent_EObj_p_foo"   function="%_EObj_p__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_p_foo"   function="%c_p__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_p_foo"   function="%s_p__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_p_foo"   function="%b_p__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_p_foo"   function="%i_p__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_q_foo"   function="%_EObj_q_c" type="0"/>
+    <gateway name="sci_percent_EObj_q_foo"   function="%_EObj_q_s" type="0"/>
+    <gateway name="sci_percent_EObj_q_foo"   function="%_EObj_q_b" type="0"/>
+    <gateway name="sci_percent_EObj_q_foo"   function="%_EObj_q_i" type="0"/>
+    <gateway name="sci_percent_EObj_q_foo"   function="%_EObj_q__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_q_foo"   function="%c_q__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_q_foo"   function="%s_q__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_q_foo"   function="%b_q__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_q_foo"   function="%i_q__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_r_foo"   function="%_EObj_r_c" type="0"/>
+    <gateway name="sci_percent_EObj_r_foo"   function="%_EObj_r_s" type="0"/>
+    <gateway name="sci_percent_EObj_r_foo"   function="%_EObj_r_b" type="0"/>
+    <gateway name="sci_percent_EObj_r_foo"   function="%_EObj_r_i" type="0"/>
+    <gateway name="sci_percent_EObj_r_foo"   function="%_EObj_r__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_r_foo"   function="%c_r__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_r_foo"   function="%s_r__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_r_foo"   function="%b_r__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_r_foo"   function="%i_r__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_s_foo"   function="%_EObj_s_c" type="0"/>
+    <gateway name="sci_percent_EObj_s_foo"   function="%_EObj_s_s" type="0"/>
+    <gateway name="sci_percent_EObj_s_foo"   function="%_EObj_s_b" type="0"/>
+    <gateway name="sci_percent_EObj_s_foo"   function="%_EObj_s_i" type="0"/>
+    <gateway name="sci_percent_EObj_s_foo"   function="%_EObj_s__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_s_foo"   function="%c_s__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_s_foo"   function="%s_s__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_s_foo"   function="%b_s__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_s_foo"   function="%i_s__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_x_foo"   function="%_EObj_x_c" type="0"/>
+    <gateway name="sci_percent_EObj_x_foo"   function="%_EObj_x_s" type="0"/>
+    <gateway name="sci_percent_EObj_x_foo"   function="%_EObj_x_b" type="0"/>
+    <gateway name="sci_percent_EObj_x_foo"   function="%_EObj_x_i" type="0"/>
+    <gateway name="sci_percent_EObj_x_foo"   function="%_EObj_x__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_x_foo"   function="%c_x__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_x_foo"   function="%s_x__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_x_foo"   function="%b_x__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_x_foo"   function="%i_x__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_y_foo"   function="%_EObj_y_c" type="0"/>
+    <gateway name="sci_percent_EObj_y_foo"   function="%_EObj_y_s" type="0"/>
+    <gateway name="sci_percent_EObj_y_foo"   function="%_EObj_y_b" type="0"/>
+    <gateway name="sci_percent_EObj_y_foo"   function="%_EObj_y_i" type="0"/>
+    <gateway name="sci_percent_EObj_y_foo"   function="%_EObj_y__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_y_foo"   function="%c_y__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_y_foo"   function="%s_y__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_y_foo"   function="%b_y__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_y_foo"   function="%i_y__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_z_foo"   function="%_EObj_z_c" type="0"/>
+    <gateway name="sci_percent_EObj_z_foo"   function="%_EObj_z_s" type="0"/>
+    <gateway name="sci_percent_EObj_z_foo"   function="%_EObj_z_b" type="0"/>
+    <gateway name="sci_percent_EObj_z_foo"   function="%_EObj_z_i" type="0"/>
+    <gateway name="sci_percent_EObj_z_foo"   function="%_EObj_z__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_z_foo"   function="%c_z__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_z_foo"   function="%s_z__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_z_foo"   function="%b_z__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_z_foo"   function="%i_z__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_1_foo"   function="%_EObj_1_c" type="0"/>
+    <gateway name="sci_percent_EObj_1_foo"   function="%_EObj_1_s" type="0"/>
+    <gateway name="sci_percent_EObj_1_foo"   function="%_EObj_1_b" type="0"/>
+    <gateway name="sci_percent_EObj_1_foo"   function="%_EObj_1_i" type="0"/>
+    <gateway name="sci_percent_EObj_1_foo"   function="%_EObj_1__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_1_foo"   function="%c_1__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_1_foo"   function="%s_1__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_1_foo"   function="%b_1__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_1_foo"   function="%i_1__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_2_foo"   function="%_EObj_2_c" type="0"/>
+    <gateway name="sci_percent_EObj_2_foo"   function="%_EObj_2_s" type="0"/>
+    <gateway name="sci_percent_EObj_2_foo"   function="%_EObj_2_b" type="0"/>
+    <gateway name="sci_percent_EObj_2_foo"   function="%_EObj_2_i" type="0"/>
+    <gateway name="sci_percent_EObj_2_foo"   function="%_EObj_2__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_2_foo"   function="%c_2__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_2_foo"   function="%s_2__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_2_foo"   function="%b_2__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_2_foo"   function="%i_2__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_3_foo"   function="%_EObj_3_c" type="0"/>
+    <gateway name="sci_percent_EObj_3_foo"   function="%_EObj_3_s" type="0"/>
+    <gateway name="sci_percent_EObj_3_foo"   function="%_EObj_3_b" type="0"/>
+    <gateway name="sci_percent_EObj_3_foo"   function="%_EObj_3_i" type="0"/>
+    <gateway name="sci_percent_EObj_3_foo"   function="%_EObj_3__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_3_foo"   function="%c_3__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_3_foo"   function="%s_3__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_3_foo"   function="%b_3__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_3_foo"   function="%i_3__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_4_foo"   function="%_EObj_4_c" type="0"/>
+    <gateway name="sci_percent_EObj_4_foo"   function="%_EObj_4_s" type="0"/>
+    <gateway name="sci_percent_EObj_4_foo"   function="%_EObj_4_b" type="0"/>
+    <gateway name="sci_percent_EObj_4_foo"   function="%_EObj_4_i" type="0"/>
+    <gateway name="sci_percent_EObj_4_foo"   function="%_EObj_4__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_4_foo"   function="%c_4__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_4_foo"   function="%s_4__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_4_foo"   function="%b_4__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_4_foo"   function="%i_4__EObj" type="0"/>
+    <gateway name="sci_percent_EObj_0"       function="%_EObj_0" type="0"/>
+    <gateway name="sci_percent_EObj_5"       function="%_EObj_5" type="0"/>
+    <gateway name="sci_percent_EObj_t"       function="%_EObj_t" type="0"/>
+    <gateway name="sci_invoke_lu"            function="invoke_lu" type="0"/>
+    <gateway name="sci_doubleExclam_invoke_" function="!!_invoke_" type="0"/>
+    <gateway name="sci_percent_EObj_disp"    function="%_EObj_disp" type="0"/>
+</module>
diff --git a/scilab/modules/external_objects/src/cpp/EOType.cpp b/scilab/modules/external_objects/src/cpp/EOType.cpp
new file mode 100644 (file)
index 0000000..01f40ac
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+* Copyright (C) 2015 - Scilab Enterprises - Antoine ELIAS
+*
+* This file must be used under the terms of the CeCILL.
+* This source file is licensed as described in the file COPYING, which
+* you should have received as part of this distribution.  The terms
+* are also available at
+* http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+*
+*/
+#include "EOType.hxx"
+namespace org_modules_external_objects
+{
+types::Callable* EOType::pFunc = nullptr;
+bool EOType::invoke(types::typed_list & in, types::optional_list & opt, int _iRetCount, types::typed_list & out, ast::ConstVisitor & execFunc, const ast::CallExp & /*e*/)
+{
+    //check some flag before call invoke
+    ScilabAbstractEnvironment & env = ScilabEnvironments::getEnvironment(id);
+    ScilabGatewayOptions & options = env.getGatewayOptions();
+    options.setIsNew(isNew);
+    in.push_back(new types::Double(static_cast<double>(id)));
+    return pFunc->call(in, opt, _iRetCount, out, &execFunc) == types::Function::OK;
+}
+}
\ No newline at end of file
diff --git a/scilab/modules/external_objects/src/cpp/EOType.hxx b/scilab/modules/external_objects/src/cpp/EOType.hxx
new file mode 100644 (file)
index 0000000..dcf9de4
--- /dev/null
@@ -0,0 +1,86 @@
+/*
+* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+* Copyright (C) 2015 - Scilab Enterprises - Antoine ELIAS
+*
+* This file must be used under the terms of the CeCILL.
+* This source file is licensed as described in the file COPYING, which
+* you should have received as part of this distribution. The terms
+* are also available at
+* http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+*
+*/
+
+#include "user.hxx"
+#include "callable.hxx"
+#include "context.hxx"
+#include "ScilabObjects.hxx"
+
+namespace org_modules_external_objects
+{
+class EOType : public types::UserType
+{
+public :
+    EOType(int envId, bool isNew) : id(envId), isNew(isNew)
+    {
+        if (pFunc == nullptr)
+        {
+            symbol::Context* ctx = symbol::Context::getInstance();
+            types::InternalType* pIT = ctx->get(symbol::Symbol(ScilabObjects::_INVOKE_));
+            if (pIT && pIT->isCallable())
+            {
+                pFunc = pIT->getAs<types::Callable>();
+            }
+        }
+    }
+    virtual ~EOType() {}
+
+    inline std::wstring getTypeStr()
+    {
+        return L"eotype";
+    }
+
+    inline std::wstring getShortTypeStr()
+    {
+        return L"eo";
+    }
+
+    InternalType* clone()
+    {
+        return new EOType(id, isNew);
+    }
+
+    inline bool hasToString()
+    {
+        return true;
+    }
+
+    inline bool toString(std::wostringstream& ostr)
+    {
+        ostr << "eotype" << std::endl;
+        return true;
+    }
+
+    inline bool isInvokable() const
+    {
+        return true;
+    }
+
+    inline bool isAssignable()
+    {
+        return false;
+    }
+
+    inline bool isCallable()
+    {
+        return true;
+    }
+
+    bool invoke(types::typed_list & in, types::optional_list & /*opt*/, int /*_iRetCount*/, types::typed_list & out, ast::ConstVisitor & execFunc, const ast::CallExp & /*e*/);
+
+private:
+    static types::Callable* pFunc;
+    int id;
+    bool isNew;
+
+};
+}
\ No newline at end of file
index 36b8fa1..9f0738f 100644 (file)
  *
  */
 
-#include "ScilabObjects.hxx"
 #include <cstring>
-
 #include <cstdio>
 #include <vector>
 
+#include "internal.hxx"
+#include "EOType.hxx"
+#include "mlist.hxx"
+#include "ScilabObjects.hxx"
+#include "context.hxx"
+#include "function.hxx"
+#include "execvisitor.hxx"
+#include "gatewaystruct.hxx"
 extern "C" {
+#include "api_scilab.h"
     extern int C2F(varfunptr)(int *, int *, int *);
 }
 
@@ -26,7 +33,10 @@ bool ScilabObjects::isInit = false;
 const char * ScilabObjects::_EOBJ[] = {"_EObj", "_EnvId", "_id"};
 const char * ScilabObjects::_ECLASS[] = {"_EClass", "_EnvId", "_id"};
 const char * ScilabObjects::_EVOID[] = {"_EVoid", "_EnvId", "_id"};
-const char * ScilabObjects::_INVOKE_ = "!!_invoke_";
+const wchar_t * ScilabObjects::_INVOKE_ = L"!!_invoke_";
+const wchar_t pwstEClass[] = {L"_EClass"};
+const wchar_t pwstEObj[] = {L"_EObj"};
+const wchar_t pwstEVoid[] = {L"_EVoid"};
 
 void ScilabObjects::initialization(ScilabAbstractEnvironment & env, void * pvApiCtx)
 {
@@ -147,39 +157,12 @@ void ScilabObjects::createEnvironmentObjectAtPos(int type, int pos, int id, cons
     }
 }
 
-void ScilabObjects::copyInvocationMacroToStack(int pos, ScilabAbstractEnvironment & env, void * pvApiCtx)
+void ScilabObjects::copyInvocationMacroToStack(int pos, const int envId, bool isNew, void * pvApiCtx)
 {
-    //static bool init = false;
-    //static int id[nsiz];
-    //static int interf = 0;
-    //static int funnumber = 0;
-
-    //if (!init)
-    //{
-    //    init = true;
-    //    C2F(str2name)(const_cast<char *>(_INVOKE_), id, strlen(_INVOKE_));
-    //    int fins = Fin;
-    //    int funs = C2F(com).fun;
-    //    Fin = -1;
-    //    C2F(funs)(id);
-    //    funnumber = Fin;
-    //    interf = C2F(com).fun;
-    //    C2F(com).fun = funs;
-    //    Fin = fins;
-    //}
-
-    //int tops = Top;
-    //// Remove 1 since varfunptr will increment Top
-    //Top = Top - Rhs + pos - 1;
-
-    //// Create a function pointer variable
-    //C2F(varfunptr)(id, &interf, &funnumber);
-    //C2F(intersci).ntypes[pos - 1] = '$';
-
-    //Top = tops;
-
-    //OptionsHelper::setCopyOccured(true);
-
+    EOType* invoke = new EOType(envId, isNew);
+    GatewayStruct* str = (GatewayStruct*)pvApiCtx;
+    //assign function as return value
+    str->m_pOut[pos - str->m_iIn - 1 /*0*/] = invoke;
 }
 
 void ScilabObjects::removeTemporaryVars(const int envId, int * tmpvar)
@@ -789,41 +772,43 @@ int ScilabObjects::getArgumentId(int * addr, int * tmpvars, const bool isRef, co
 
 int ScilabObjects::getMListType(int * mlist, void * pvApiCtx)
 {
-    char * mlist_type[3];
-    char * mtype = 0;
-    int lengths[3];
-    int rows, cols;
-    int type;
+    types::InternalType* pVar = (types::InternalType*) mlist;
 
-    // OK it's crappy... but it works and it is performant...
+    //if (mlist[0] == 0)
+    //{
+    //    return EXTERNAL_VOID;
+    //}
 
-    if (mlist[0] == 0)
+    if (!pVar->isMList())
     {
-        return EXTERNAL_VOID;
+        return EXTERNAL_INVALID;
     }
 
-    if (mlist[0] != sci_mlist || mlist[1] != 3)
+    types::MList* pMlist = pVar->getAs<types::MList>();
+    if (pMlist->getSize() != 3)
     {
         return EXTERNAL_INVALID;
     }
 
-    if (mlist[6] != sci_strings || mlist[7] != 1 || mlist[8] != 3)
+    types::String* pStrFieldNames = pMlist->getFieldNames();
+    if (pStrFieldNames->getSize() != 3)
     {
         // first field is not a matrix 1x3 of strings
         return EXTERNAL_INVALID;
     }
 
-    if (mlist[11] - 1 == strlen("_EClass") && mlist[14] == 36 && mlist[15] == -14 && mlist[16] == -12 && mlist[17] == 21 && mlist[18] == 10 && mlist[19] == 28 && mlist[20] == 28)
+    wchar_t* pwstMlistType = pStrFieldNames->get(0);
+    if (wcslen(pwstMlistType) == strlen("_EClass") && wcscmp(pwstMlistType, L"_EClass") == 0)
     {
         return EXTERNAL_CLASS;
     }
 
-    if (mlist[11] - 1 == strlen("_EObj") && mlist[14] == 36 && mlist[15] == -14 && mlist[16] == -24 && mlist[17] == 11 && mlist[18] == 19)
+    if (wcslen(pwstMlistType) == strlen("_EObj") && wcscmp(pwstMlistType, L"_EObj") == 0)
     {
         return EXTERNAL_OBJECT;
     }
 
-    if (mlist[11] - 1 == strlen("_EVoid") && mlist[14] == 36 && mlist[15] == -14 && mlist[16] == -31 && mlist[17] == 24 && mlist[18] == 18 && mlist[19] == 13)
+    if (wcslen(pwstMlistType) == strlen("_EVoid") && wcscmp(pwstMlistType, L"_EVoid") == 0)
     {
         return EXTERNAL_VOID;
     }
index b71b900..511e7e4 100644 (file)
@@ -45,7 +45,7 @@ int ScilabGateway::addNamedVariable(char * fname, const int envId, void * pvApiC
     {
         idObj = ScilabObjects::getArgumentId(addr, tmpvar, false, false, envId, pvApiCtx);
     }
-    catch (ScilabAbstractEnvironmentException & e)
+    catch (ScilabAbstractEnvironmentException & /*e*/)
     {
         freeAllocatedSingleString(varName);
         throw;
@@ -55,7 +55,7 @@ int ScilabGateway::addNamedVariable(char * fname, const int envId, void * pvApiC
     {
         env.addNamedVariable(idObj, varName);
     }
-    catch (std::exception & e)
+    catch (std::exception & /*e*/)
     {
         freeAllocatedSingleString(varName);
         ScilabObjects::removeTemporaryVars(envId, tmpvar);
index 37cb8f2..5db4a54 100644 (file)
@@ -65,7 +65,7 @@ int ScilabGateway::addToClasspath(char * fname, const int envId, void * pvApiCtx
                 {
                     env.addtoclasspath(expandedPath);
                 }
-                catch (std::exception & e)
+                catch (std::exception & /*e*/)
                 {
                     FREE(expandedPath);
                     freeAllocatedMatrixOfString(rows, cols, className);
index 772c521..c41f85d 100644 (file)
@@ -62,7 +62,7 @@ int ScilabGateway::array(char * fname, const int envId, void * pvApiCtx)
     {
         ret = env.createarray(className, args, Rhs - 1);
     }
-    catch (std::exception & e)
+    catch (std::exception & /*e*/)
     {
         delete[] args;
         freeAllocatedSingleString(className);
@@ -76,7 +76,7 @@ int ScilabGateway::array(char * fname, const int envId, void * pvApiCtx)
     {
         ScilabObjects::createEnvironmentObjectAtPos(EXTERNAL_OBJECT, Rhs + 1, ret, envId, pvApiCtx);
     }
-    catch (ScilabAbstractEnvironmentException & e)
+    catch (ScilabAbstractEnvironmentException & /*e*/)
     {
         env.removeobject(ret);
         throw;
index e92d005..da72142 100644 (file)
@@ -65,7 +65,7 @@ int ScilabGateway::cast(char * fname, const int envId, void * pvApiCtx)
         {
             ret = env.castwithid(idObj, *id);
         }
-        catch (std::exception & e)
+        catch (std::exception & /*e*/)
         {
             ScilabObjects::removeTemporaryVars(envId, tmpvar);
             throw;
@@ -77,7 +77,7 @@ int ScilabGateway::cast(char * fname, const int envId, void * pvApiCtx)
         {
             objName = ScilabObjects::getSingleString(2, pvApiCtx);
         }
-        catch (ScilabAbstractEnvironmentException & e)
+        catch (ScilabAbstractEnvironmentException & /*e*/)
         {
             ScilabObjects::removeTemporaryVars(envId, tmpvar);
             throw;
@@ -87,7 +87,7 @@ int ScilabGateway::cast(char * fname, const int envId, void * pvApiCtx)
         {
             ret = env.cast(idObj, objName);
         }
-        catch (std::exception & e)
+        catch (std::exception & /*e*/)
         {
             freeAllocatedSingleString(objName);
             ScilabObjects::removeTemporaryVars(envId, tmpvar);
@@ -102,7 +102,7 @@ int ScilabGateway::cast(char * fname, const int envId, void * pvApiCtx)
     {
         ScilabObjects::createEnvironmentObjectAtPos(EXTERNAL_OBJECT, Rhs + 1, ret, envId, pvApiCtx);
     }
-    catch (ScilabAbstractEnvironmentException & e)
+    catch (ScilabAbstractEnvironmentException & /*e*/)
     {
         env.removeobject(ret);
         throw;
index e084b27..394344b 100644 (file)
@@ -50,7 +50,7 @@ int ScilabGateway::classExtract(char * fname, const int envId, void * pvApiCtx)
     {
         fieldName = ScilabObjects::getSingleString(1, pvApiCtx);
     }
-    catch (ScilabAbstractEnvironmentException & e)
+    catch (ScilabAbstractEnvironmentException & /*e*/)
     {
         ScilabObjects::removeTemporaryVars(eId, tmpvar);
         throw;
@@ -66,7 +66,7 @@ int ScilabGateway::classExtract(char * fname, const int envId, void * pvApiCtx)
         {
             type = env.getfieldtype(idObj, fieldName);
         }
-        catch (std::exception & e)
+        catch (std::exception & /*e*/)
         {
             ScilabObjects::removeTemporaryVars(eId, tmpvar);
             freeAllocatedSingleString(fieldName);
@@ -82,7 +82,8 @@ int ScilabGateway::classExtract(char * fname, const int envId, void * pvApiCtx)
         options.setMethodName(fieldName);
         options.setObjId(idObj);
         OptionsHelper::setEnvId(eId);
-        ScilabObjects::copyInvocationMacroToStack(Rhs + 1, env, pvApiCtx);
+        OptionsHelper::setCopyOccurred(true);
+        ScilabObjects::copyInvocationMacroToStack(Rhs + 1, eId, options.getIsNew(), pvApiCtx);
 
         LhsVar(1) = Rhs + 1;
         PutLhsVar();
@@ -95,7 +96,7 @@ int ScilabGateway::classExtract(char * fname, const int envId, void * pvApiCtx)
         {
             ret = env.getfield(idObj, fieldName);
         }
-        catch (std::exception & e)
+        catch (std::exception & /*e*/)
         {
             freeAllocatedSingleString(fieldName);
             throw;
@@ -111,7 +112,7 @@ int ScilabGateway::classExtract(char * fname, const int envId, void * pvApiCtx)
                 {
                     ScilabObjects::createEnvironmentObjectAtPos(EXTERNAL_OBJECT, Rhs + 1, ret, eId, pvApiCtx);
                 }
-                catch (ScilabAbstractEnvironmentException & e)
+                catch (ScilabAbstractEnvironmentException & /*e*/)
                 {
                     env.removeobject(ret);
                     throw;
@@ -128,7 +129,7 @@ int ScilabGateway::classExtract(char * fname, const int envId, void * pvApiCtx)
             {
                 ScilabObjects::createEnvironmentObjectAtPos(EXTERNAL_OBJECT, Rhs + 1, ret, eId, pvApiCtx);
             }
-            catch (ScilabAbstractEnvironmentException & e)
+            catch (ScilabAbstractEnvironmentException & /*e*/)
             {
                 env.removeobject(ret);
                 throw;
index 0944818..9acda4d 100644 (file)
  */
 
 #include "ScilabGateway.hxx"
-
+extern "C"
+{
+#include "os_string.h"
+}
 namespace org_modules_external_objects
 {
 
@@ -36,7 +39,7 @@ int ScilabGateway::compile(char * fname, const int envId, void * pvApiCtx)
 
     if (Rhs == 1)
     {
-        className = strdup("");
+        className = os_strdup("");
     }
     else
     {
@@ -86,7 +89,7 @@ int ScilabGateway::compile(char * fname, const int envId, void * pvApiCtx)
     {
         ret = env.compilecode(className, code, row != 1 ? row : col);
     }
-    catch (std::exception & e)
+    catch (std::exception & /*e*/)
     {
         freeAllocatedSingleString(className);
         freeAllocatedMatrixOfString(row, col, code);
@@ -106,7 +109,7 @@ int ScilabGateway::compile(char * fname, const int envId, void * pvApiCtx)
         {
             ScilabObjects::createEnvironmentObjectAtPos(EXTERNAL_CLASS, Rhs + 1, ret, envId, pvApiCtx);
         }
-        catch (ScilabAbstractEnvironmentException & e)
+        catch (ScilabAbstractEnvironmentException & /*e*/)
         {
             env.removeobject(ret);
             throw;
index b7b545d..c0ea2db 100644 (file)
  *
  */
 
-#include "ScilabGateway.hxx"
-
 extern "C" {
 #include "scicurdir.h"
+#include "os_string.h"
 }
 
+#include "function.hxx"
+#include "string.hxx"
+#include "context.hxx"
+#include "execvisitor.hxx"
+#include "ScilabGateway.hxx"
+
 namespace org_modules_external_objects
 {
 
+//no need to delete, just a pointer on existing varaible
+static types::Callable* pCall = nullptr;
+
 int ScilabGateway::deff(char * fname, const int envId, void * pvApiCtx)
 {
-    //static int ONE = 1;
-    //static int TWO = 2;
-    //static int THREE = 3;
-
-    //SciErr err;
-    //char ** names[] = {0, 0, 0};
-    //int ret = 0;
-    //std::ostringstream os;
-    //char * str;
-    //int * addr[] = {0, 0, 0};
-    //int rows[] = {0, 0, 0};
-    //int cols[] = {0, 0, 0};
-    //int error = 0;
-    //char * cwd = 0;
-
-    //CheckInputArgument(pvApiCtx, 3, 3);
-
-    //ScilabAbstractEnvironment & env = ScilabEnvironments::getEnvironment(envId);
-    //ScilabGatewayOptions & options = env.getGatewayOptions();
-    //OptionsHelper & helper = env.getOptionsHelper();
-    //OptionsHelper::setCopyOccured(false);
-    //ScilabObjects::initialization(env, pvApiCtx);
-    //options.setIsNew(false);
-
-    //for (int i = 0; i < 3; i++)
-    //{
-    //    err = getVarAddressFromPosition(pvApiCtx, i + 1, &(addr[i]));
-    //    if (err.iErr)
-    //    {
-    //        throw ScilabAbstractEnvironmentException(__LINE__, __FILE__, gettext("Invalid variable: cannot retrieve the data"));
-    //    }
-
-    //    if (!isStringType(pvApiCtx, addr[i]))
-    //    {
-    //        throw ScilabAbstractEnvironmentException(__LINE__, __FILE__, gettext("Wrong type for input argument #%d: A String expected."), 1);
-    //    }
-
-    //    err = getVarDimension(pvApiCtx, addr[i], &(rows[i]), &(cols[i]));
-    //    if (err.iErr)
-    //    {
-    //        throw ScilabAbstractEnvironmentException(__LINE__, __FILE__, gettext("Invalid variable: cannot retrieve the data"));
-    //    }
-    //}
-
-    //if (rows[0] != 1 || cols[0] != 1)
-    //{
-    //    throw ScilabAbstractEnvironmentException(__LINE__, __FILE__, gettext("Invalid dimensions for input argument #%d: A single string expected."), 1);
-    //}
-
-    //if (rows[1] != rows[2] || cols[1] != cols[2])
-    //{
-    //    throw ScilabAbstractEnvironmentException(__LINE__, __FILE__, gettext("Invalid dimensions: arguments #2 and #3 must have the same."));
-    //}
-
-    //for (int i = 0; i < 3; i++)
-    //{
-    //    if (getAllocatedMatrixOfString(pvApiCtx, addr[i], &(rows[i]), &(cols[i]), &(names[i])))
-    //    {
-    //        for (int j = 0; j < i; j++)
-    //        {
-    //            freeAllocatedMatrixOfString(rows[j], cols[j], names[j]);
-    //        }
-    //        throw ScilabAbstractEnvironmentException(__LINE__, __FILE__, gettext("Invalid variable: cannot retrieve the data"));
-    //    }
-    //}
-
-    //cwd = scigetcwd(&error);
-    //if (error)
-    //{
-    //    FREE(cwd);
-    //    cwd = 0;
-    //}
-
-    //try
-    //{
-    //    ret = env.loadclass(names[0][0], cwd, false, helper.getAllowReload());
-    //}
-    //catch (std::exception & e)
-    //{
-    //    FREE(cwd);
-    //    for (int j = 0; j < 3; j++)
-    //    {
-    //        freeAllocatedMatrixOfString(rows[j], cols[j], names[j]);
-    //    }
-    //    throw;
-    //}
-    //FREE(cwd);
-
-    //for (int i = 0; i < rows[1] * cols[1]; i++)
-    //{
-    //    err = createMatrixOfString(pvApiCtx, ONE, 1, 1, (const char * const *) & (names[2][i]));
-    //    if (err.iErr)
-    //    {
-    //        for (int j = 0; j < 3; j++)
-    //        {
-    //            freeAllocatedMatrixOfString(rows[j], cols[j], names[j]);
-    //        }
-    //        env.removeobject(ret);
-    //        throw ScilabAbstractEnvironmentException(__LINE__, __FILE__, gettext("Invalid variable: cannot create the data"));
-    //    }
-
-    //    os.str("");
-    //    os << "y=" << names[2][i] << "(varargin)" << std::flush;
-    //    str = strdup(os.str().c_str());
-
-    //    err = createMatrixOfString(pvApiCtx, TWO, 1, 1, (const char * const *)&str);
-    //    free(str);
-    //    if (err.iErr)
-    //    {
-    //        for (int j = 0; j < 3; j++)
-    //        {
-    //            freeAllocatedMatrixOfString(rows[j], cols[j], names[j]);
-    //        }
-    //        env.removeobject(ret);
-    //        throw ScilabAbstractEnvironmentException(__LINE__, __FILE__, gettext("Invalid variable: cannot create the data"));
-    //    }
-
-    //    os.str("");
-    //    os << "y=invoke_lu(int32(" << ret << "),int32(" << envId << "),\"" << names[1][i] << "\",varargin)" << std::flush;
-    //    str = strdup(os.str().c_str());
-
-    //    err = createMatrixOfString(pvApiCtx, THREE, 1, 1, (const char * const *)&str);
-    //    free(str);
-    //    if (err.iErr)
-    //    {
-    //        for (int j = 0; j < 3; j++)
-    //        {
-    //            freeAllocatedMatrixOfString(rows[j], cols[j], names[j]);
-    //        }
-    //        env.removeobject(ret);
-    //        throw ScilabAbstractEnvironmentException(__LINE__, __FILE__, gettext("Invalid variable: cannot create the data"));
-    //    }
-
-    //    SciString(&ONE, const_cast<char *>("!_deff_wrapper"), &ONE, &THREE);
-    //}
-
-    //for (int i = 0; i < 3; i++)
-    //{
-    //    freeAllocatedMatrixOfString(rows[0], cols[0], names[i]);
-    //}
-
-    //LhsVar(1) = 0;
-    //PutLhsVar();
+    static int ONE = 1;
+    static int TWO = 2;
+    static int THREE = 3;
+
+    SciErr err;
+    char ** names[] = {0, 0, 0};
+    int ret = 0;
+    std::ostringstream os;
+    int * addr[] = {0, 0, 0};
+    int rows[] = {0, 0, 0};
+    int cols[] = {0, 0, 0};
+    int error = 0;
+    char * cwd = 0;
+
+    CheckInputArgument(pvApiCtx, 3, 3);
+
+    ScilabAbstractEnvironment & env = ScilabEnvironments::getEnvironment(envId);
+    ScilabGatewayOptions & options = env.getGatewayOptions();
+    OptionsHelper & helper = env.getOptionsHelper();
+    OptionsHelper::setCopyOccurred(false);
+    ScilabObjects::initialization(env, pvApiCtx);
+    options.setIsNew(false);
+
+    if (pCall == nullptr)
+    {
+        symbol::Context* ctx = symbol::Context::getInstance();
+        types::InternalType* pIT = ctx->get(symbol::Symbol(L"#_deff_wrapper"));
+        if (pIT && pIT->isCallable())
+        {
+            pCall = pIT->getAs<types::Callable>();
+        }
+        else
+        {
+            throw ScilabAbstractEnvironmentException(__LINE__, __FILE__, gettext("Invalid variable: cannot retrieve the data"));
+        }
+    }
+
+    for (int i = 0; i < 3; i++)
+    {
+        err = getVarAddressFromPosition(pvApiCtx, i + 1, &(addr[i]));
+        if (err.iErr)
+        {
+            throw ScilabAbstractEnvironmentException(__LINE__, __FILE__, gettext("Invalid variable: cannot retrieve the data"));
+        }
+
+        if (!isStringType(pvApiCtx, addr[i]))
+        {
+            throw ScilabAbstractEnvironmentException(__LINE__, __FILE__, gettext("Wrong type for input argument #%d: A String expected."), 1);
+        }
+
+        err = getVarDimension(pvApiCtx, addr[i], &(rows[i]), &(cols[i]));
+        if (err.iErr)
+        {
+            throw ScilabAbstractEnvironmentException(__LINE__, __FILE__, gettext("Invalid variable: cannot retrieve the data"));
+        }
+    }
+
+    if (rows[0] != 1 || cols[0] != 1)
+    {
+        throw ScilabAbstractEnvironmentException(__LINE__, __FILE__, gettext("Invalid dimensions for input argument #%d: A single string expected."), 1);
+    }
+
+    if (rows[1] != rows[2] || cols[1] != cols[2])
+    {
+        throw ScilabAbstractEnvironmentException(__LINE__, __FILE__, gettext("Invalid dimensions: arguments #2 and #3 must have the same."));
+    }
+
+    for (int i = 0; i < 3; i++)
+    {
+        if (getAllocatedMatrixOfString(pvApiCtx, addr[i], &(rows[i]), &(cols[i]), &(names[i])))
+        {
+            for (int j = 0; j < i; j++)
+            {
+                freeAllocatedMatrixOfString(rows[j], cols[j], names[j]);
+            }
+            throw ScilabAbstractEnvironmentException(__LINE__, __FILE__, gettext("Invalid variable: cannot retrieve the data"));
+        }
+    }
+
+    cwd = scigetcwd(&error);
+    if (error)
+    {
+        FREE(cwd);
+        cwd = 0;
+    }
+
+    try
+    {
+        ret = env.loadclass(names[0][0], cwd, false, helper.getAllowReload());
+    }
+    catch (std::exception & /*e*/)
+    {
+        FREE(cwd);
+        for (int j = 0; j < 3; j++)
+        {
+            freeAllocatedMatrixOfString(rows[j], cols[j], names[j]);
+        }
+        throw;
+    }
+    FREE(cwd);
+
+    for (int i = 0; i < rows[1] * cols[1]; i++)
+    {
+        //call #_deff_wrapper
+        types::typed_list in, out;
+        types::optional_list opt;
+
+        //name
+        in.push_back(new types::String(names[2][i]));
+
+
+        //protopype
+        os.str("");
+        os << "y=" << names[2][i] << "(varargin)" << std::flush;
+        in.push_back(new types::String(os.str().c_str()));
+
+        //body
+        os.str("");
+        os << "y=invoke_lu(int32(" << ret << "),int32(" << envId << "),\"" << names[1][i] << "\",varargin)" << std::flush;
+        in.push_back(new types::String(os.str().c_str()));
+
+        ast::ExecVisitor exec;
+        if (pCall->call(in, opt, 0, out, &exec) != types::Function::OK)
+        {
+            throw ScilabAbstractEnvironmentException(__LINE__, __FILE__, gettext("Invalid variable: cannot create the data"));
+        }
+    }
+
+    for (int i = 0; i < 3; i++)
+    {
+        freeAllocatedMatrixOfString(rows[0], cols[0], names[i]);
+    }
+
+    LhsVar(1) = 0;
+    PutLhsVar();
 
     return 0;
 }
index bb1d2c7..3e8c37c 100644 (file)
@@ -25,30 +25,28 @@ int ScilabGateway::doubleExclam_invoke(char * fname, const int envId, void * pvA
     int * addr = 0;
     int * tmpvar = 0;
     int * args = 0;
-    int eId = OptionsHelper::getEnvId();
     int ret = 0;
     int * sret = 0;
-    int len = Rhs;
-    int nbArgs = len;
+    int len = Rhs - 1;
     std::vector<int> torem;
 
     CheckOutputArgument(pvApiCtx, 1, 1);
 
-    ScilabAbstractEnvironment & env = ScilabEnvironments::getEnvironment(eId);
+    ScilabAbstractEnvironment & env = ScilabEnvironments::getEnvironment(envId);
     ScilabGatewayOptions & options = env.getGatewayOptions();
     OptionsHelper & helper = env.getOptionsHelper();
     ScilabObjects::initialization(env, pvApiCtx);
 
-    if (!OptionsHelper::getCopyOccurred()) // if the function is called outside a method context, then return null
-    {
-        //TODO: get null for environment
-        ScilabObjects::unwrap(0, Rhs + 1, eId, pvApiCtx);
+    //if (!OptionsHelper::getCopyOccurred()) // if the function is called outside a method context, then return null
+    //{
+    //    //TODO: get null for environment
+    //    ScilabObjects::unwrap(0, Rhs + 1, envId, pvApiCtx);
 
-        LhsVar(1) = Rhs + 1;
-        PutLhsVar();
+    //    LhsVar(1) = Rhs + 1;
+    //    PutLhsVar();
 
-        return 0;
-    }
+    //    return 0;
+    //}
 
     OptionsHelper::setCopyOccurred(false);
 
@@ -60,7 +58,7 @@ int ScilabGateway::doubleExclam_invoke(char * fname, const int envId, void * pvA
         return 0;
     }
 
-    if (Rhs == 1)
+    if (len == 1)
     {
         err = getVarAddressFromPosition(pvApiCtx, 1, &addr);
         if (err.iErr)
@@ -83,7 +81,7 @@ int ScilabGateway::doubleExclam_invoke(char * fname, const int envId, void * pvA
         err = getVarAddressFromPosition(pvApiCtx, i + 1, &addr);
         if (err.iErr)
         {
-            ScilabObjects::removeTemporaryVars(eId, tmpvar);
+            ScilabObjects::removeTemporaryVars(envId, tmpvar);
             delete[] tmpvar;
             delete[] args;
             throw ScilabAbstractEnvironmentException(__LINE__, __FILE__, gettext("Invalid variable: cannot retrieve the data"));
@@ -91,9 +89,9 @@ int ScilabGateway::doubleExclam_invoke(char * fname, const int envId, void * pvA
 
         try
         {
-            args[i] = ScilabObjects::getArgumentId(addr, tmpvar, false, false, eId, pvApiCtx);
+            args[i] = ScilabObjects::getArgumentId(addr, tmpvar, false, false, envId, pvApiCtx);
         }
-        catch (ScilabAbstractEnvironmentException & e)
+        catch (ScilabAbstractEnvironmentException & /*e*/)
         {
             delete[] tmpvar;
             delete[] args;
@@ -107,17 +105,17 @@ int ScilabGateway::doubleExclam_invoke(char * fname, const int envId, void * pvA
         {
             ret = env.newinstance(options.getObjId(), args, len);
         }
-        catch (std::exception & e)
+        catch (std::exception & /*e*/)
         {
             options.setIsNew(false);
-            ScilabObjects::removeTemporaryVars(eId, tmpvar);
+            ScilabObjects::removeTemporaryVars(envId, tmpvar);
             delete[] tmpvar;
             delete[] args;
             throw;
         }
 
         options.setIsNew(false);
-        ScilabObjects::removeTemporaryVars(eId, tmpvar);
+        ScilabObjects::removeTemporaryVars(envId, tmpvar);
         delete[] tmpvar;
         delete[] args;
         options.setMethodName(0);
@@ -131,9 +129,9 @@ int ScilabGateway::doubleExclam_invoke(char * fname, const int envId, void * pvA
 
         try
         {
-            ScilabObjects::createEnvironmentObjectAtPos(EXTERNAL_OBJECT, Rhs + 1, ret, eId, pvApiCtx);
+            ScilabObjects::createEnvironmentObjectAtPos(EXTERNAL_OBJECT, Rhs + 1, ret, envId, pvApiCtx);
         }
-        catch (ScilabAbstractEnvironmentException & e)
+        catch (ScilabAbstractEnvironmentException & /*e*/)
         {
             env.removeobject(ret);
             throw;
@@ -150,9 +148,9 @@ int ScilabGateway::doubleExclam_invoke(char * fname, const int envId, void * pvA
         {
             sret = env.invoke(options.getObjId(), options.getMethodName(), args, len);
         }
-        catch (std::exception & e)
+        catch (std::exception & /*e*/)
         {
-            ScilabObjects::removeTemporaryVars(eId, tmpvar);
+            ScilabObjects::removeTemporaryVars(envId, tmpvar);
             delete[] tmpvar;
             delete[] args;
             options.setMethodName(0);
@@ -160,7 +158,7 @@ int ScilabGateway::doubleExclam_invoke(char * fname, const int envId, void * pvA
         }
     }
 
-    ScilabObjects::removeTemporaryVars(eId, tmpvar);
+    ScilabObjects::removeTemporaryVars(envId, tmpvar);
     delete[] tmpvar;
     delete[] args;
     options.setMethodName(0);
@@ -182,17 +180,17 @@ int ScilabGateway::doubleExclam_invoke(char * fname, const int envId, void * pvA
         torem.reserve(*sret);
         for (int i = 1; i <= *sret; i++)
         {
-            if (!ScilabObjects::unwrap(sret[i], Rhs + i, eId, pvApiCtx))
+            if (!ScilabObjects::unwrap(sret[i], Rhs + i, envId, pvApiCtx))
             {
                 try
                 {
-                    ScilabObjects::createEnvironmentObjectAtPos(EXTERNAL_OBJECT, Rhs + i, sret[i], eId, pvApiCtx);
+                    ScilabObjects::createEnvironmentObjectAtPos(EXTERNAL_OBJECT, Rhs + i, sret[i], envId, pvApiCtx);
                 }
-                catch (ScilabAbstractEnvironmentException & e)
+                catch (ScilabAbstractEnvironmentException & /*e*/)
                 {
                     if (!torem.empty())
                     {
-                        env.removeobject(&(torem[0]), torem.size());
+                        env.removeobject(&(torem[0]), static_cast<int>(torem.size()));
                     }
                     env.removeobject(sret + 1, *sret);
                     delete[] sret;
@@ -209,7 +207,7 @@ int ScilabGateway::doubleExclam_invoke(char * fname, const int envId, void * pvA
 
         if (!torem.empty())
         {
-            env.removeobject(&(torem[0]), torem.size());
+            env.removeobject(&(torem[0]), static_cast<int>(torem.size()));
         }
     }
     else
@@ -218,9 +216,9 @@ int ScilabGateway::doubleExclam_invoke(char * fname, const int envId, void * pvA
         {
             try
             {
-                ScilabObjects::createEnvironmentObjectAtPos(EXTERNAL_OBJECT, Rhs + i, sret[i], eId, pvApiCtx);
+                ScilabObjects::createEnvironmentObjectAtPos(EXTERNAL_OBJECT, Rhs + i, sret[i], envId, pvApiCtx);
             }
-            catch (ScilabAbstractEnvironmentException & e)
+            catch (ScilabAbstractEnvironmentException & /*e*/)
             {
                 env.removeobject(sret + 1, *sret);
                 delete[] sret;
index 594371f..6c01610 100644 (file)
@@ -92,7 +92,7 @@ int ScilabGateway::evalString(char * fname, const int envId, void * pvApiCtx)
     {
         env.evalString(const_cast<const char **>(code), row * col, allocator);
     }
-    catch (std::exception & e)
+    catch (std::exception & /*e*/)
     {
         freeAllocatedMatrixOfString(row, col, code);
         throw;
index 0a2e3ce..b4cff8e 100644 (file)
@@ -55,14 +55,14 @@ int ScilabGateway::exists(char * fname, const int envId, void * pvApiCtx)
     {
         exists = env.isvalidobject(*id);
     }
-    catch (std::exception & e)
+    catch (std::exception & /*e*/)
     {
         throw;
     }
 
-    createScalarBoolean(pvApiCtx, 1, exists ? 1 : 0);
+    createScalarBoolean(pvApiCtx, Rhs + 1, exists ? 1 : 0);
 
-    LhsVar(1) = 1;
+    LhsVar(1) = Rhs + 1;
     PutLhsVar();
 
     return 0;
index 4f015b7..964f3be 100644 (file)
@@ -51,7 +51,7 @@ int ScilabGateway::getClassName(char * fname, const int envId, void * pvApiCtx)
         {
             idObj = ScilabObjects::getArgumentId(addr, tmpvar, false, false, envId, pvApiCtx);
         }
-        catch (ScilabAbstractEnvironmentException & e)
+        catch (ScilabAbstractEnvironmentException & /*e*/)
         {
             delete[] tmpvar;
             delete[] classNames;
@@ -62,7 +62,7 @@ int ScilabGateway::getClassName(char * fname, const int envId, void * pvApiCtx)
         {
             classNames[i - 1] = env.getclassname(idObj);
         }
-        catch (std::exception & e)
+        catch (std::exception & /*e*/)
         {
             ScilabObjects::removeTemporaryVars(envId, tmpvar);
             delete[] tmpvar;
index 438c792..58f07f1 100644 (file)
  */
 
 #include "ScilabGateway.hxx"
-
+extern "C"
+{
+#include "os_string.h"
+}
 namespace org_modules_external_objects
 {
 
@@ -45,7 +48,7 @@ int ScilabGateway::getEnvironmentName(char * fname, const int envId, void * pvAp
     options.setIsNew(false);
 
     envName = env.getEnvironmentName();
-    str = strdup(envName.c_str());
+    str = os_strdup(envName.c_str());
 
     err = createMatrixOfString(pvApiCtx, Rhs + 1, 1, 1, (const char * const *)&str);
     free(str);
index 768b449..c8aa1c9 100644 (file)
@@ -46,7 +46,7 @@ int ScilabGateway::getField(char * fname, const int envId, void * pvApiCtx)
     {
         fieldName = ScilabObjects::getSingleString(2, pvApiCtx);
     }
-    catch (ScilabAbstractEnvironmentException & e)
+    catch (ScilabAbstractEnvironmentException & /*e*/)
     {
         ScilabObjects::removeTemporaryVars(envId, tmpvar);
         throw;
@@ -78,7 +78,7 @@ int ScilabGateway::getField(char * fname, const int envId, void * pvApiCtx)
     {
         ret = env.getfield(idObj, fieldName);
     }
-    catch (std::exception & e)
+    catch (std::exception & /*e*/)
     {
         ScilabObjects::removeTemporaryVars(envId, tmpvar);
         freeAllocatedSingleString(fieldName);
@@ -98,7 +98,7 @@ int ScilabGateway::getField(char * fname, const int envId, void * pvApiCtx)
         {
             ScilabObjects::createEnvironmentObjectAtPos(EXTERNAL_OBJECT, Rhs + 1, ret, envId, pvApiCtx);
         }
-        catch (ScilabAbstractEnvironmentException & e)
+        catch (ScilabAbstractEnvironmentException & /*e*/)
         {
             env.removeobject(ret);
             throw;
index 83eb932..b9ff237 100644 (file)
@@ -50,7 +50,7 @@ int ScilabGateway::getFields(char * fname, const int envId, void * pvApiCtx)
     {
         env.getaccessiblefields(idObj, *allocator);
     }
-    catch (std::exception & e)
+    catch (std::exception & /*e*/)
     {
         delete allocator;
         throw;
index 5751e5a..1873ed4 100644 (file)
@@ -35,7 +35,7 @@ int ScilabGateway::getNamedVariable(char * fname, const int envId, void * pvApiC
     {
         idObj = env.getNamedVariable(varName);
     }
-    catch (std::exception & e)
+    catch (std::exception & /*e*/)
     {
         freeAllocatedSingleString(varName);
         throw;
@@ -46,7 +46,7 @@ int ScilabGateway::getNamedVariable(char * fname, const int envId, void * pvApiC
     {
         ScilabObjects::createEnvironmentObjectAtPos(EXTERNAL_OBJECT, Rhs + 1, idObj, envId, pvApiCtx);
     }
-    catch (ScilabAbstractEnvironmentException & e)
+    catch (ScilabAbstractEnvironmentException & /*e*/)
     {
         env.removeobject(idObj);
         throw;
index 18ce980..3092807 100644 (file)
@@ -172,9 +172,9 @@ int ScilabGateway::import(char * fname, const int envId, void * pvApiCtx)
     {
         try
         {
-            ret = env.loadclass(className[i], cwd, static_cast<bool>(named), helper.getAllowReload());
+            ret = env.loadclass(className[i], cwd, named != 0, helper.getAllowReload());
         }
-        catch (std::exception & e)
+        catch (std::exception & /*e*/)
         {
             FREE(cwd);
             freeAllocatedMatrixOfString(rows, cols, className);
@@ -191,7 +191,7 @@ int ScilabGateway::import(char * fname, const int envId, void * pvApiCtx)
             {
                 ScilabObjects::createNamedEnvironmentObject(type, name[i].c_str(), ret, envId, pvApiCtx);
             }
-            catch (ScilabAbstractEnvironmentException & e)
+            catch (ScilabAbstractEnvironmentException & /*e*/)
             {
                 FREE(cwd);
                 freeAllocatedMatrixOfString(rows, cols, className);
@@ -205,7 +205,7 @@ int ScilabGateway::import(char * fname, const int envId, void * pvApiCtx)
             {
                 ScilabObjects::createEnvironmentObjectAtPos(type, Rhs + i + 1, ret, envId, pvApiCtx);
             }
-            catch (ScilabAbstractEnvironmentException & e)
+            catch (ScilabAbstractEnvironmentException & /*e*/)
             {
                 FREE(cwd);
                 freeAllocatedMatrixOfString(rows, cols, className);
index d4551be..298b15c 100644 (file)
@@ -52,7 +52,7 @@ int ScilabGateway::invoke(char * fname, const int envId, void * pvApiCtx)
     {
         idObj = ScilabObjects::getArgumentId(addr, tmpvar, false, false, envId, pvApiCtx);
     }
-    catch (ScilabAbstractEnvironmentException & e)
+    catch (ScilabAbstractEnvironmentException & /*e*/)
     {
         delete[] tmpvar;
         throw;
@@ -81,7 +81,7 @@ int ScilabGateway::invoke(char * fname, const int envId, void * pvApiCtx)
         {
             args[i] = ScilabObjects::getArgumentId(addr, tmpvar, false, false, envId, pvApiCtx);
         }
-        catch (ScilabAbstractEnvironmentException & e)
+        catch (ScilabAbstractEnvironmentException & /*e*/)
         {
             delete[] args;
             ScilabObjects::removeTemporaryVars(envId, tmpvar);
@@ -99,7 +99,7 @@ int ScilabGateway::invoke(char * fname, const int envId, void * pvApiCtx)
     {
         methName = ScilabObjects::getSingleString(2, pvApiCtx);
     }
-    catch (ScilabAbstractEnvironmentException & e)
+    catch (ScilabAbstractEnvironmentException & /*e*/)
     {
         delete[] args;
         ScilabObjects::removeTemporaryVars(envId, tmpvar);
@@ -111,7 +111,7 @@ int ScilabGateway::invoke(char * fname, const int envId, void * pvApiCtx)
     {
         ret = env.invoke(idObj, methName, args, nbArgs);
     }
-    catch (std::exception & e)
+    catch (std::exception & /*e*/)
     {
         delete[] args;
         ScilabObjects::removeTemporaryVars(envId, tmpvar);
@@ -148,11 +148,11 @@ int ScilabGateway::invoke(char * fname, const int envId, void * pvApiCtx)
                 {
                     ScilabObjects::createEnvironmentObjectAtPos(EXTERNAL_OBJECT, Rhs + i, ret[i], envId, pvApiCtx);
                 }
-                catch (ScilabAbstractEnvironmentException & e)
+                catch (ScilabAbstractEnvironmentException & /*e*/)
                 {
                     if (!torem.empty())
                     {
-                        env.removeobject(&(torem[0]), torem.size());
+                        env.removeobject(&(torem[0]), static_cast<int>(torem.size()));
                     }
                     env.removeobject(ret + 1, *ret);
                     delete[] ret;
@@ -169,7 +169,7 @@ int ScilabGateway::invoke(char * fname, const int envId, void * pvApiCtx)
 
         if (!torem.empty())
         {
-            env.removeobject(&(torem[0]), torem.size());
+            env.removeobject(&(torem[0]), static_cast<int>(torem.size()));
         }
     }
     else
@@ -180,7 +180,7 @@ int ScilabGateway::invoke(char * fname, const int envId, void * pvApiCtx)
             {
                 ScilabObjects::createEnvironmentObjectAtPos(EXTERNAL_OBJECT, Rhs + i, ret[i], envId, pvApiCtx);
             }
-            catch (ScilabAbstractEnvironmentException & e)
+            catch (ScilabAbstractEnvironmentException & /*e*/)
             {
                 env.removeobject(ret + 1, *ret);
                 delete[] ret;
index 3fcf318..43d40f5 100644 (file)
@@ -51,7 +51,7 @@ int ScilabGateway::invoke_asref(char * fname, const int envId, void * pvApiCtx)
     {
         idObj = ScilabObjects::getArgumentId(addr, tmpvar, false, false, envId, pvApiCtx);
     }
-    catch (ScilabAbstractEnvironmentException & e)
+    catch (ScilabAbstractEnvironmentException & /*e*/)
     {
         delete[] tmpvar;
         throw;
@@ -80,7 +80,7 @@ int ScilabGateway::invoke_asref(char * fname, const int envId, void * pvApiCtx)
 
             args[i] = ScilabObjects::getArgumentId(addr, tmpvar, true, false, envId, pvApiCtx);
         }
-        catch (ScilabAbstractEnvironmentException & e)
+        catch (ScilabAbstractEnvironmentException & /*e*/)
         {
             if (varName)
             {
@@ -108,7 +108,7 @@ int ScilabGateway::invoke_asref(char * fname, const int envId, void * pvApiCtx)
     {
         methName = ScilabObjects::getSingleString(2, pvApiCtx);
     }
-    catch (ScilabAbstractEnvironmentException & e)
+    catch (ScilabAbstractEnvironmentException & /*e*/)
     {
         delete[] args;
         ScilabObjects::removeTemporaryVars(envId, tmpvar);
@@ -120,7 +120,7 @@ int ScilabGateway::invoke_asref(char * fname, const int envId, void * pvApiCtx)
     {
         ret = env.invoke(idObj, methName, args, nbArgs);
     }
-    catch (std::exception & e)
+    catch (std::exception & /*e*/)
     {
         delete[] args;
         ScilabObjects::removeTemporaryVars(envId, tmpvar);
@@ -156,7 +156,7 @@ int ScilabGateway::invoke_asref(char * fname, const int envId, void * pvApiCtx)
                 {
                     ScilabObjects::createEnvironmentObjectAtPos(EXTERNAL_OBJECT, Rhs + i, ret[i], envId, pvApiCtx);
                 }
-                catch (ScilabAbstractEnvironmentException & e)
+                catch (ScilabAbstractEnvironmentException & /*e*/)
                 {
                     for (int j = 1; j <= *ret; j++)
                     {
@@ -182,7 +182,7 @@ int ScilabGateway::invoke_asref(char * fname, const int envId, void * pvApiCtx)
             {
                 ScilabObjects::createEnvironmentObjectAtPos(EXTERNAL_OBJECT, Rhs + i, ret[i], envId, pvApiCtx);
             }
-            catch (ScilabAbstractEnvironmentException & e)
+            catch (ScilabAbstractEnvironmentException & /*e*/)
             {
                 for (int j = 1; j <= *ret; j++)
                 {
index 20be51b..8b5807e 100644 (file)
@@ -171,7 +171,7 @@ int ScilabGateway::invoke_lu(char * fname, const int envId, void * pvApiCtx)
         {
             args[i] = ScilabObjects::getArgumentId(child, tmpvar, false, false, *eId, pvApiCtx);
         }
-        catch (ScilabAbstractEnvironmentException & e)
+        catch (ScilabAbstractEnvironmentException & /*e*/)
         {
             delete[] args;
             delete[] tmpvar;
@@ -188,7 +188,7 @@ int ScilabGateway::invoke_lu(char * fname, const int envId, void * pvApiCtx)
     {
         methName = ScilabObjects::getSingleString(3, pvApiCtx);
     }
-    catch (ScilabAbstractEnvironmentException & e)
+    catch (ScilabAbstractEnvironmentException & /*e*/)
     {
         delete[] args;
         ScilabObjects::removeTemporaryVars(*eId, tmpvar);
@@ -200,7 +200,7 @@ int ScilabGateway::invoke_lu(char * fname, const int envId, void * pvApiCtx)
     {
         ret = env.invoke(idObj, methName, args, nbArgs);
     }
-    catch (std::exception & e)
+    catch (std::exception & /*e*/)
     {
         delete[] args;
         ScilabObjects::removeTemporaryVars(*eId, tmpvar);
@@ -236,11 +236,11 @@ int ScilabGateway::invoke_lu(char * fname, const int envId, void * pvApiCtx)
             {
                 ScilabObjects::createEnvironmentObjectAtPos(EXTERNAL_OBJECT, Rhs + i, ret[i], *eId, pvApiCtx);
             }
-            catch (ScilabAbstractEnvironmentException & e)
+            catch (ScilabAbstractEnvironmentException & /*e*/)
             {
                 if (!torem.empty())
                 {
-                    env.removeobject(&(torem[0]), torem.size());
+                    env.removeobject(&(torem[0]), static_cast<int>(torem.size()));
                 }
                 env.removeobject(ret + 1, *ret);
                 delete[] ret;
@@ -257,7 +257,7 @@ int ScilabGateway::invoke_lu(char * fname, const int envId, void * pvApiCtx)
 
     if (!torem.empty())
     {
-        env.removeobject(&(torem[0]), torem.size());
+        env.removeobject(&(torem[0]), static_cast<int>(torem.size()));
     }
 
     delete[] ret;
index 4770a98..dc9b8f6 100644 (file)
@@ -51,7 +51,7 @@ int ScilabGateway::invoke(char * fname, const int envId, ScilabAbstractInvoker &
         {
             args[i] = ScilabObjects::getArgumentId(addr, tmpvar, false, false, envId, pvApiCtx);
         }
-        catch (ScilabAbstractEnvironmentException & e)
+        catch (ScilabAbstractEnvironmentException & /*e*/)
         {
             delete[] args;
             delete[] tmpvar;
@@ -68,7 +68,7 @@ int ScilabGateway::invoke(char * fname, const int envId, ScilabAbstractInvoker &
     {
         ret = invoker.invoke(args, nbArgs);
     }
-    catch (std::exception & e)
+    catch (std::exception & /*e*/)
     {
         delete[] args;
         ScilabObjects::removeTemporaryVars(envId, tmpvar);
@@ -95,7 +95,7 @@ int ScilabGateway::invoke(char * fname, const int envId, ScilabAbstractInvoker &
             {
                 ScilabObjects::createEnvironmentObjectAtPos(EXTERNAL_OBJECT, Rhs + 1, ret, envId, pvApiCtx);
             }
-            catch (ScilabAbstractEnvironmentException & e)
+            catch (ScilabAbstractEnvironmentException & /*e*/)
             {
                 env.removeobject(ret);
                 throw;
@@ -112,7 +112,7 @@ int ScilabGateway::invoke(char * fname, const int envId, ScilabAbstractInvoker &
         {
             ScilabObjects::createEnvironmentObjectAtPos(EXTERNAL_OBJECT, Rhs + 1, ret, envId, pvApiCtx);
         }
-        catch (ScilabAbstractEnvironmentException & e)
+        catch (ScilabAbstractEnvironmentException & /*e*/)
         {
             env.removeobject(ret);
             throw;
index 2f1d348..4984702 100644 (file)
@@ -64,7 +64,7 @@ int ScilabGateway::newInstance(char * fname, const int envId, void * pvApiCtx)
         {
             idClass = env.loadclass(className, cwd, false, helper.getAllowReload());
         }
-        catch (std::exception & e)
+        catch (std::exception & /*e*/)
         {
             if (cwd)
             {
@@ -102,7 +102,7 @@ int ScilabGateway::newInstance(char * fname, const int envId, void * pvApiCtx)
         {
             args[i] = ScilabObjects::getArgumentId(addr, tmpvar, false, false, envId, pvApiCtx);
         }
-        catch (ScilabAbstractEnvironmentException & e)
+        catch (ScilabAbstractEnvironmentException & /*e*/)
         {
             delete[] args;
             delete[] tmpvar;
@@ -119,7 +119,7 @@ int ScilabGateway::newInstance(char * fname, const int envId, void * pvApiCtx)
     {
         ret = env.newinstance(idClass, args, nbArgs);
     }
-    catch (std::exception & e)
+    catch (std::exception & /*e*/)
     {
         delete[] args;
         ScilabObjects::removeTemporaryVars(envId, tmpvar);
@@ -135,7 +135,7 @@ int ScilabGateway::newInstance(char * fname, const int envId, void * pvApiCtx)
     {
         ScilabObjects::createEnvironmentObjectAtPos(EXTERNAL_OBJECT, Rhs + 1, ret, envId, pvApiCtx);
     }
-    catch (ScilabAbstractEnvironmentException & e)
+    catch (ScilabAbstractEnvironmentException & /*e*/)
     {
         env.removeobject(ret);
         throw;
index 10c3490..c3a7e0e 100644 (file)
@@ -76,7 +76,9 @@ int ScilabGateway::objectExtract(char * fname, const int envId, void * pvApiCtx)
         {
             ret = env.getarrayelement(idObj, tab, Rhs - 1);
         }
-        catch (std::exception & e) { }
+        catch (std::exception & /*e*/)
+        {
+        }
 
         delete[] tab;
     }
@@ -100,7 +102,7 @@ int ScilabGateway::objectExtract(char * fname, const int envId, void * pvApiCtx)
             {
                 type = env.getfieldtype(idObj, fieldName);
             }
-            catch (std::exception & e)
+            catch (std::exception & /*e*/)
             {
                 freeAllocatedSingleString(fieldName);
                 throw;
@@ -135,7 +137,7 @@ int ScilabGateway::objectExtract(char * fname, const int envId, void * pvApiCtx)
                 {
                     args[i] = ScilabObjects::getArgumentId(laddr, tmpvar, false, false, eId, pvApiCtx);
                 }
-                catch (ScilabAbstractEnvironmentException & e)
+                catch (ScilabAbstractEnvironmentException & /*e*/)
                 {
                     delete[] tmpvar;
                     delete[] args;
@@ -147,7 +149,7 @@ int ScilabGateway::objectExtract(char * fname, const int envId, void * pvApiCtx)
             {
                 ret = env.extract(idObj, args, Rhs - 1);
             }
-            catch (std::exception & e)
+            catch (std::exception & /*e*/)
             {
                 ScilabObjects::removeTemporaryVars(eId, tmpvar);
                 delete[] tmpvar;
@@ -167,7 +169,7 @@ int ScilabGateway::objectExtract(char * fname, const int envId, void * pvApiCtx)
                 options.setMethodName(fieldName);
                 options.setObjId(idObj);
                 OptionsHelper::setEnvId(eId);
-                ScilabObjects::copyInvocationMacroToStack(Rhs + 1, env, pvApiCtx);
+                ScilabObjects::copyInvocationMacroToStack(Rhs + 1, eId, options.getIsNew(), pvApiCtx);
 
                 LhsVar(1) = Rhs + 1;
                 PutLhsVar();
@@ -180,7 +182,7 @@ int ScilabGateway::objectExtract(char * fname, const int envId, void * pvApiCtx)
                 {
                     ret = env.getfield(idObj, fieldName);
                 }
-                catch (std::exception & e)
+                catch (std::exception & /*e*/)
                 {
                     freeAllocatedSingleString(fieldName);
                     throw;
@@ -200,7 +202,7 @@ int ScilabGateway::objectExtract(char * fname, const int envId, void * pvApiCtx)
 
                 ScilabObjects::createEnvironmentObjectAtPos(EXTERNAL_OBJECT, Rhs + 1, ret, eId, pvApiCtx);
             }
-            catch (ScilabAbstractEnvironmentException & e)
+            catch (ScilabAbstractEnvironmentException & /*e*/)
             {
                 env.removeobject(ret);
                 throw;
@@ -217,7 +219,7 @@ int ScilabGateway::objectExtract(char * fname, const int envId, void * pvApiCtx)
         {
             ScilabObjects::createEnvironmentObjectAtPos(EXTERNAL_OBJECT, Rhs + 1, ret, eId, pvApiCtx);
         }
-        catch (ScilabAbstractEnvironmentException & e)
+        catch (ScilabAbstractEnvironmentException & /*e*/)
         {
             env.removeobject(ret);
             throw;
index eec85a0..9f144a5 100644 (file)
@@ -87,7 +87,7 @@ int ScilabGateway::objectInsert(char * fname, const int envId, void * pvApiCtx)
         {
             env.setarrayelement(idObjA, tab, Rhs - 2, idObjB);
         }
-        catch (std::exception & e)
+        catch (std::exception & /*e*/)
         {
             delete[] tab;
             ScilabObjects::removeTemporaryVars(envIdA, tmpvarB);
@@ -127,7 +127,7 @@ int ScilabGateway::objectInsert(char * fname, const int envId, void * pvApiCtx)
         {
             type = env.getfieldtype(idObjA, fieldName);
         }
-        catch (std::exception & e)
+        catch (std::exception & /*e*/)
         {
             ScilabObjects::removeTemporaryVars(envIdA, tmpvarB);
             freeAllocatedSingleString(fieldName);
@@ -141,7 +141,7 @@ int ScilabGateway::objectInsert(char * fname, const int envId, void * pvApiCtx)
         {
             env.setfield(idObjA, fieldName, idObjB);
         }
-        catch (std::exception & e)
+        catch (std::exception & /*e*/)
         {
             ScilabObjects::removeTemporaryVars(envIdA, tmpvarB);
             freeAllocatedSingleString(fieldName);
@@ -179,7 +179,7 @@ int ScilabGateway::objectInsert(char * fname, const int envId, void * pvApiCtx)
             {
                 args[i] = ScilabObjects::getArgumentId(laddr, tmpvar, false, false, envIdA, pvApiCtx);
             }
-            catch (ScilabAbstractEnvironmentException & e)
+            catch (ScilabAbstractEnvironmentException & /*e*/)
             {
                 ScilabObjects::removeTemporaryVars(envIdA, tmpvarB);
                 delete[] tmpvar;
@@ -194,7 +194,7 @@ int ScilabGateway::objectInsert(char * fname, const int envId, void * pvApiCtx)
         {
             env.insert(idObjA, args, Rhs - 1);
         }
-        catch (std::exception & e)
+        catch (std::exception & /*e*/)
         {
             ScilabObjects::removeTemporaryVars(envIdA, tmpvarB);
             ScilabObjects::removeTemporaryVars(envIdA, tmpvar);
index f82936b..ab78a94 100644 (file)
@@ -46,7 +46,7 @@ int ScilabGateway::objectPrint(char * fname, const int envId, void * pvApiCtx)
     {
         rep = env.getrepresentation(idObj);
     }
-    catch (std::exception & e)
+    catch (std::exception & /*e*/)
     {
         ScilabObjects::removeTemporaryVars(eId, tmpvar);
         throw;
index fb3eeb6..3fc05a2 100644 (file)
@@ -38,7 +38,7 @@ int ScilabGateway::operation(char * fname, const int envId, const OperatorsType
     {
         eId = ScilabObjects::getEnvironmentId(addr, pvApiCtx);
     }
-    catch (ScilabAbstractEnvironmentException & e)
+    catch (ScilabAbstractEnvironmentException & /*e*/)
     {
         err = getVarAddressFromPosition(pvApiCtx, 2, &addr);
         if (err.iErr)
@@ -71,7 +71,7 @@ int ScilabGateway::operation(char * fname, const int envId, const OperatorsType
         {
             idObjB = ScilabObjects::getArgumentId(addr, tmpvar, false, false, eId, pvApiCtx);
         }
-        catch (std::exception & e)
+        catch (std::exception & /*e*/)
         {
             throw;
         }
@@ -81,7 +81,7 @@ int ScilabGateway::operation(char * fname, const int envId, const OperatorsType
     {
         ret = env.operation(idObjA, idObjB, type);
     }
-    catch (std::exception & e)
+    catch (std::exception & /*e*/)
     {
         ScilabObjects::removeTemporaryVars(eId, tmpvar);
         throw;
@@ -97,7 +97,7 @@ int ScilabGateway::operation(char * fname, const int envId, const OperatorsType
             {
                 ScilabObjects::createEnvironmentObjectAtPos(EXTERNAL_OBJECT, Rhs + 1, ret, eId, pvApiCtx);
             }
-            catch (ScilabAbstractEnvironmentException & e)
+            catch (ScilabAbstractEnvironmentException & /*e*/)
             {
                 env.removeobject(ret);
                 throw;
@@ -114,7 +114,7 @@ int ScilabGateway::operation(char * fname, const int envId, const OperatorsType
         {
             ScilabObjects::createEnvironmentObjectAtPos(EXTERNAL_OBJECT, Rhs + 1, ret, eId, pvApiCtx);
         }
-        catch (ScilabAbstractEnvironmentException & e)
+        catch (ScilabAbstractEnvironmentException & /*e*/)
         {
             env.removeobject(ret);
             throw;
index a520672..d3ada34 100644 (file)
@@ -44,7 +44,7 @@ int ScilabGateway::setField(char * fname, const int envId, void * pvApiCtx)
     {
         fieldName = ScilabObjects::getSingleString(2, pvApiCtx);
     }
-    catch (ScilabAbstractEnvironmentException & e)
+    catch (ScilabAbstractEnvironmentException & /*e*/)
     {
         ScilabObjects::removeTemporaryVars(envId, tmpvar);
         throw;
@@ -62,7 +62,7 @@ int ScilabGateway::setField(char * fname, const int envId, void * pvApiCtx)
     {
         arg = ScilabObjects::getArgumentId(addr, tmpvar, false, false, envId, pvApiCtx);
     }
-    catch (ScilabAbstractEnvironmentException & e)
+    catch (ScilabAbstractEnvironmentException & /*e*/)
     {
         freeAllocatedSingleString(fieldName);
         ScilabObjects::removeTemporaryVars(envId, tmpvar);
@@ -73,7 +73,7 @@ int ScilabGateway::setField(char * fname, const int envId, void * pvApiCtx)
     {
         env.setfield(idObj, fieldName, arg);
     }
-    catch (std::exception & e)
+    catch (std::exception & /*e*/)
     {
         freeAllocatedSingleString(fieldName);
         ScilabObjects::removeTemporaryVars(envId, tmpvar);
index f5e0ceb..232a107 100644 (file)
@@ -65,7 +65,7 @@ int ScilabGateway::trace(char * fname, const int envId, void * pvApiCtx)
             {
                 env.enabletrace(expandedPath);
             }
-            catch (std::exception & e)
+            catch (std::exception & /*e*/)
             {
                 FREE(expandedPath);
                 throw;
index 02cccf5..8a94d51 100644 (file)
@@ -61,7 +61,9 @@ int ScilabGateway::unwrap(char * fname, const int envId, void * pvApiCtx)
             {
                 ScilabObjects::createEnvironmentObjectAtPos(EXTERNAL_OBJECT, Rhs + i, *id, envId, pvApiCtx);
             }
-            catch (ScilabAbstractEnvironmentException & e) { }
+            catch (ScilabAbstractEnvironmentException & /*e*/)
+            {
+            }
         }
 
         LhsVar(i) = Rhs + i;
index f6fe2d8..3d02351 100644 (file)
@@ -61,7 +61,9 @@ int ScilabGateway::unwrapremove(char * fname, const int envId, void * pvApiCtx)
             {
                 ScilabObjects::createEnvironmentObjectAtPos(EXTERNAL_OBJECT, Rhs + i, *id, envId, pvApiCtx);
             }
-            catch (ScilabAbstractEnvironmentException & e) { }
+            catch (ScilabAbstractEnvironmentException & /*e*/)
+            {
+            }
         }
 
         LhsVar(i) = Rhs + i;
index 8d23559..2a873bb 100644 (file)
@@ -52,7 +52,7 @@ int ScilabGateway::wrap(char * fname, const int envId, void * pvApiCtx)
         {
             idObj = ScilabObjects::getArgumentId(addr, tmpvar, false, false, envId, pvApiCtx);
         }
-        catch (ScilabAbstractEnvironmentException & e)
+        catch (ScilabAbstractEnvironmentException & /*e*/)
         {
             delete[] tmpvar;
             throw ScilabAbstractEnvironmentException(__LINE__, __FILE__, gettext("Cannot wrap argument %d."), i);
@@ -62,7 +62,7 @@ int ScilabGateway::wrap(char * fname, const int envId, void * pvApiCtx)
         {
             ScilabObjects::createEnvironmentObjectAtPos(EXTERNAL_OBJECT, Rhs + i, idObj, envId, pvApiCtx);
         }
-        catch (ScilabAbstractEnvironmentException & e)
+        catch (ScilabAbstractEnvironmentException & /*e*/)
         {
             ScilabObjects::removeTemporaryVars(envId, tmpvar);
             delete[] tmpvar;
index abe85f7..623197e 100644 (file)
@@ -76,7 +76,7 @@ int ScilabGateway::wrapAsRef(char * fname, const int envId, void * pvApiCtx)
         {
             idObj = ScilabObjects::getArgumentId(addr, tmpvar, true, false, envId, pvApiCtx);
         }
-        catch (ScilabAbstractEnvironmentException & e)
+        catch (ScilabAbstractEnvironmentException & /*e*/)
         {
             delete[] tmpvar;
             throw ScilabAbstractEnvironmentException(__LINE__, __FILE__, gettext("Cannot wrap argument %d."), i);
@@ -86,7 +86,7 @@ int ScilabGateway::wrapAsRef(char * fname, const int envId, void * pvApiCtx)
         {
             ScilabObjects::createEnvironmentObjectAtPos(EXTERNAL_OBJECT, Rhs + i, idObj, envId, pvApiCtx);
         }
-        catch (ScilabAbstractEnvironmentException & e)
+        catch (ScilabAbstractEnvironmentException & /*e*/)
         {
             ScilabObjects::removeTemporaryVars(envId, tmpvar);
             delete[] tmpvar;
index 8be12a8..25ee5a8 100644 (file)
@@ -8,7 +8,7 @@
 // http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
 
 // TODO : make this '72' more dynamic (with a funptr)
-intppty(72);
+intppty("external_objects_java");
 jvoid = evoid;
 jnull = enull;
 //load("SCI/modules/external_objects_java/macros/lib");
\ No newline at end of file
index 8938399..408ebac 100644 (file)
@@ -1,6 +1,7 @@
 <?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
+/* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
  * Copyright (C) 2012 - Scilab Enterprises - Calixte Denizet
  *
  * This file must be used under the terms of the CeCILL.
@@ -8,52 +9,39 @@
  * you should have received as part of this distribution.  The terms
  * are also available at
  * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
- *
- -->
-<!DOCTYPE GATEWAY SYSTEM "../../functions/xml/gateway.dtd">
-<GATEWAY name="external_objects_java">
-    
-    <!--
+ */
  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.
 
- gatewayId is the position in the hashtable 'Interfaces' defined in the
- file SCI/modules/core/src/c/callinterf.h
-
- primitiveId is the position in the hashtable '<module>Table Tab[]' defined
- in the file modules/<module>/sci_gateway/c/gw_<module>.c
-
- primitiveName is the name of the Scilab function
-
  Don't touch if you do not know what you are doing
-
 -->
-    <PRIMITIVE gatewayId="72" primitiveId="1" primitiveName="jimport" />
-    <PRIMITIVE gatewayId="72" primitiveId="2" primitiveName="jgetclassname" />
-    <PRIMITIVE gatewayId="72" primitiveId="3" primitiveName="jwrap" />
-    <PRIMITIVE gatewayId="72" primitiveId="4" primitiveName="jgetmethods" />
-    <PRIMITIVE gatewayId="72" primitiveId="5" primitiveName="jgetfields" />
-    <PRIMITIVE gatewayId="72" primitiveId="6" primitiveName="jgetfield" />
-    <PRIMITIVE gatewayId="72" primitiveId="7" primitiveName="jcompile" />
-    <PRIMITIVE gatewayId="72" primitiveId="8" primitiveName="jnewInstance" />
-    <PRIMITIVE gatewayId="72" primitiveId="9" primitiveName="jremove" />
-    <PRIMITIVE gatewayId="72" primitiveId="10" primitiveName="jexists" />
-    <PRIMITIVE gatewayId="72" primitiveId="11" primitiveName="junwrap" />
-    <PRIMITIVE gatewayId="72" primitiveId="12" primitiveName="junwraprem" />
-    <PRIMITIVE gatewayId="72" primitiveId="13" primitiveName="jenableTrace" />
-    <PRIMITIVE gatewayId="72" primitiveId="14" primitiveName="jdisableTrace" />
-    <PRIMITIVE gatewayId="72" primitiveId="15" primitiveName="jdeff" />
-    <PRIMITIVE gatewayId="72" primitiveId="16" primitiveName="jarray" />
-    <PRIMITIVE gatewayId="72" primitiveId="17" primitiveName="jcast" />
-    <PRIMITIVE gatewayId="72" primitiveId="18" primitiveName="jallowClassReloading" />
-    <PRIMITIVE gatewayId="72" primitiveId="19" primitiveName="jwrapinfloat" />
-    <PRIMITIVE gatewayId="72" primitiveId="20" primitiveName="jsetfield" />
-    <PRIMITIVE gatewayId="72" primitiveId="21" primitiveName="jautoUnwrap" />
-    <PRIMITIVE gatewayId="72" primitiveId="22" primitiveName="jautoTranspose" />
-    <PRIMITIVE gatewayId="72" primitiveId="23" primitiveName="jinvoke" />
-    <PRIMITIVE gatewayId="72" primitiveId="24" primitiveName="jconvMatrixMethod" />
-    <PRIMITIVE gatewayId="72" primitiveId="25" primitiveName="jgetinfo" />
-    <PRIMITIVE gatewayId="72" primitiveId="26" primitiveName="jinvoke_db" />
-    <PRIMITIVE gatewayId="72" primitiveId="27" primitiveName="jcreatejar" />
-</GATEWAY>
+<module name="external_objects_java">
+    <gateway name="sci_jimport"              function="jimport"              type="0" />
+    <gateway name="sci_jgetclassname"        function="jgetclassname"        type="0" />
+    <gateway name="sci_jwrap"                function="jwrap"                type="0" />
+    <gateway name="sci_jgetmethods"          function="jgetmethods"          type="0" />
+    <gateway name="sci_jgetfields"           function="jgetfields"           type="0" />
+    <gateway name="sci_jgetfield"            function="jgetfield"            type="0" />
+    <gateway name="sci_jcompile"             function="jcompile"             type="0" />
+    <gateway name="sci_jnewInstance"         function="jnewInstance"         type="0" />
+    <gateway name="sci_jremove"              function="jremove"              type="0" />
+    <gateway name="sci_jexists"              function="jexists"              type="0" />
+    <gateway name="sci_junwrap"              function="junwrap"              type="0" />
+    <gateway name="sci_junwraprem"           function="junwraprem"           type="0" />
+    <gateway name="sci_jenableTrace"         function="jenableTrace"         type="0" />
+    <gateway name="sci_jdisableTrace"        function="jdisableTrace"        type="0" />
+    <gateway name="sci_jdeff"                function="jdeff"                type="0" />
+    <gateway name="sci_jarray"               function="jarray"               type="0" />
+    <gateway name="sci_jcast"                function="jcast"                type="0" />
+    <gateway name="sci_jallowClassReloading" function="jallowClassReloading" type="0" />
+    <gateway name="sci_jwrapinfloat"         function="jwrapinfloat"         type="0" />
+    <gateway name="sci_jsetfield"            function="jsetfield"            type="0" />
+    <gateway name="sci_jautoUnwrap"          function="jautoUnwrap"          type="0" />
+    <gateway name="sci_jautoTranspose"       function="jautoTranspose"       type="0" />
+    <gateway name="sci_jinvoke"              function="jinvoke"              type="0" />
+    <gateway name="sci_jconvMatrixMethod"    function="jconvMatrixMethod"    type="0" />
+    <gateway name="sci_jgetinfo"             function="jgetinfo"             type="0" />
+    <gateway name="sci_jinvoke_db"           function="jinvoke_db"           type="0" />
+    <gateway name="sci_jcreatejar"           function="jcreatejar"           type="0" />
+</module>
index fe7af56..bd0d0c8 100644 (file)
@@ -562,19 +562,19 @@ void ScilabJavaEnvironmentWrapper::unwrapmatuint(int id, const ScilabUIntStackAl
 void ScilabJavaEnvironmentWrapper::unwraplong(int id, const ScilabLongStackAllocator & allocator) const
 {
     JavaVM * vm = getScilabJavaVM();
-    unwrapSingle<jlong, int, long long>(vm, id, allocator, true);
+    unwrapSingle<jlong, long long, long long>(vm, id, allocator, true);
 }
 
 void ScilabJavaEnvironmentWrapper::unwraprowlong(int id, const ScilabLongStackAllocator & allocator) const
 {
     JavaVM * vm = getScilabJavaVM();
-    unwrapRow<jlong, int, long long>(vm, id, allocator, true);
+    unwrapRow<jlong, long long>(vm, id, allocator);
 }
 
 void ScilabJavaEnvironmentWrapper::unwrapmatlong(int id, const ScilabLongStackAllocator & allocator) const
 {
     JavaVM * vm = getScilabJavaVM();
-    unwrapMat<jlong, int, long long>(vm, id, allocator);
+    unwrapMat<jlong, long long>(vm, id, allocator);
 }
 
 void ScilabJavaEnvironmentWrapper::unwrapulong(int id, const ScilabULongStackAllocator & allocator) const
index d017ec4..5e303ca 100644 (file)
@@ -32,6 +32,7 @@ import java.util.Locale;
 import java.util.ServiceLoader;
 import java.util.logging.Level;
 
+import javax.swing.SwingUtilities;
 import javax.tools.Diagnostic;
 import javax.tools.DiagnosticCollector;
 import javax.tools.FileObject;
@@ -116,7 +117,29 @@ public class ScilabJavaCompiler {
      * @return an integer corresponding to the compiled and loaded class.
      */
     public static int compileCode(String className, String[] code) throws ScilabJavaException {
-        findCompiler();
+        if (SwingUtilities.isEventDispatchThread()) {
+            findCompiler();
+        } else {
+            try {
+                SwingUtilities.invokeAndWait(new Runnable() {
+                    @Override
+                    public void run() {
+                        try {
+                            findCompiler();
+                        } catch (ScilabJavaException e) {
+                            // TODO Auto-generated catch block
+                            e.printStackTrace();
+                        }
+                    }
+                });
+            } catch (InvocationTargetException e) {
+                // TODO Auto-generated catch block
+                e.printStackTrace();
+            } catch (InterruptedException e) {
+                // TODO Auto-generated catch block
+                e.printStackTrace();
+            }
+        }
 
         DiagnosticCollector<JavaFileObject> diagnostics = new DiagnosticCollector<JavaFileObject>();
         StandardJavaFileManager stdFileManager = compiler.getStandardFileManager(null, Locale.getDefault(), null);
index 05a76a4..1e4933b 100644 (file)
@@ -13,3 +13,7 @@
 jdeff("java.lang.Double", "parseDouble", "str2number");
 PI = str2number("3.141592653589");
 assert_checkalmostequal(PI,%pi);
+clear str2number;
+jdeff("java.lang.Double", ["parseDouble", "toString"], ["str2dbl", "dbl2str"]);
+assert_checkalmostequal(str2dbl(dbl2str(%pi)), %pi);
+clear str2dbl dbl2str;
index fd11048..a9e08ef 100644 (file)
@@ -14,3 +14,8 @@
 jdeff("java.lang.Double", "parseDouble", "str2number");
 PI = str2number("3.141592653589");
 assert_checkalmostequal(PI,%pi);
+clear str2number;
+
+jdeff("java.lang.Double", ["parseDouble", "toString"], ["str2dbl", "dbl2str"]);
+assert_checkalmostequal(str2dbl(dbl2str(%pi)), %pi);
+clear str2dbl dbl2str;
index 9638410..7cf4db2 100644 (file)
@@ -8,4 +8,4 @@ jimport java.lang.Double;
 d = Double.new("1.23456");
 assert_checktrue(jexists(d));
 jremove d;
-assert_checkerror("jexists(d)",[],4);
+assert_checkequal(exists("d"),0);
index 8e4b86b..7eba18a 100644 (file)
@@ -9,4 +9,4 @@ jimport java.lang.Double;
 d = Double.new("1.23456");
 assert_checktrue(jexists(d));
 jremove d;
-assert_checkerror("jexists(d)",[],4);
+assert_checkequal(exists("d"),0);
index 976dc84..a79290d 100644 (file)
@@ -88,7 +88,7 @@ c = jcompile("Test", ["public class Test {";
 "}";]);
 t = c.new();
 assert_checkequal(jgetclassname(c),"Test");
-assert_checkequal(int32([1,2,3,4]), junwrap(t.returnLong()));
+assert_checkequal(int64([1,2,3,4]), junwrap(t.returnLong()));
 c = jcompile("Test", ["public class Test {";
 "public long returnLong() {";
 "    return 32L;";
@@ -96,7 +96,7 @@ c = jcompile("Test", ["public class Test {";
 "}";]);
 t = c.new();
 assert_checkequal(jgetclassname(c),"Test");
-assert_checkequal(int32(32), junwrap(t.returnLong()));
+assert_checkequal(int64(32), junwrap(t.returnLong()));
 //////////////////////////////////////////////
 c = jcompile("Test", ["public class Test {";
 "public float[] returnFloat() {";
index 18d5bde..b8eb8f5 100644 (file)
@@ -105,7 +105,7 @@ c = jcompile("Test", ["public class Test {";
 "}";]);
 t = c.new();
 assert_checkequal(jgetclassname(c),"Test");
-assert_checkequal(int32([1,2,3,4]), junwrap(t.returnLong()));
+assert_checkequal(int64([1,2,3,4]), junwrap(t.returnLong()));
 
 c = jcompile("Test", ["public class Test {";
 "public long returnLong() {";
@@ -114,7 +114,7 @@ c = jcompile("Test", ["public class Test {";
 "}";]);
 t = c.new();
 assert_checkequal(jgetclassname(c),"Test");
-assert_checkequal(int32(32), junwrap(t.returnLong()));
+assert_checkequal(int64(32), junwrap(t.returnLong()));
 
 //////////////////////////////////////////////
 
index 2517148..5b6c384 100644 (file)
@@ -86,7 +86,7 @@ c = jcompile("Test", ["public class Test {";
 "}";]);
 t = c.new();
 assert_checkequal(jgetclassname(c),"Test");
-assert_checkequal(int32([1,2,3,4]), t.returnLong());
+assert_checkequal(int64([1,2,3,4]), t.returnLong());
 c = jcompile("Test", ["public class Test {";
 "public long returnLong() {";
 "    return 32L;";
@@ -94,7 +94,7 @@ c = jcompile("Test", ["public class Test {";
 "}";]);
 t = c.new();
 assert_checkequal(jgetclassname(c),"Test");
-assert_checkequal(int32(32), t.returnLong());
+assert_checkequal(int64(32), t.returnLong());
 //////////////////////////////////////////////
 c = jcompile("Test", ["public class Test {";
 "public float[] returnFloat() {";
index c09cbca..727da4f 100644 (file)
@@ -103,7 +103,7 @@ c = jcompile("Test", ["public class Test {";
 "}";]);
 t = c.new();
 assert_checkequal(jgetclassname(c),"Test");
-assert_checkequal(int32([1,2,3,4]), t.returnLong());
+assert_checkequal(int64([1,2,3,4]), t.returnLong());
 
 c = jcompile("Test", ["public class Test {";
 "public long returnLong() {";
@@ -112,7 +112,7 @@ c = jcompile("Test", ["public class Test {";
 "}";]);
 t = c.new();
 assert_checkequal(jgetclassname(c),"Test");
-assert_checkequal(int32(32), t.returnLong());
+assert_checkequal(int64(32), t.returnLong());
 
 //////////////////////////////////////////////
 
index 71b429f..0aa96d9 100644 (file)
@@ -188,4 +188,16 @@ public :
     static int Load();
 };
 
+class ExternalObjectsModule : public GenericModule
+{
+public :
+    static int Load();
+};
+
+class ExternalObjectsJavaModule : public GenericModule
+{
+public :
+    static int Load();
+};
+
 #endif /* !__DYNAMIC_MODULES_HXX_ */
index 4da2e0b..4139673 100644 (file)
@@ -591,3 +591,41 @@ int MPIModule::Load()
     FREE(pwstLibName);
     return 1;
 }
+
+int ExternalObjectsModule::Load()
+{
+    wstring wstModuleName = L"external_objects";
+#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;
+}
+
+int ExternalObjectsJavaModule::Load()
+{
+    wstring wstModuleName = L"external_objects_java";
+#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 5682776..841f3a3 100644 (file)
@@ -348,6 +348,8 @@ bool FuncManager::CreateModuleList(void)
     m_ModuleMap[L"xcos"] = pair<GW_MOD, GW_MOD>(&XcosModule::Load, &XcosModule::Unload);
     m_ModuleMap[L"fftw"] = pair<GW_MOD, GW_MOD>(&FFTWModule::Load, &FFTWModule::Unload);
     m_ModuleMap[L"mpi"] = pair<GW_MOD, GW_MOD>(&MPIModule::Load, &MPIModule::Unload);
+    m_ModuleMap[L"external_objects"] = pair<GW_MOD, GW_MOD>(&ExternalObjectsModule::Load, &ExternalObjectsModule::Unload);
+    m_ModuleMap[L"external_objects_java"] = pair<GW_MOD, GW_MOD>(&ExternalObjectsJavaModule::Load, &ExternalObjectsJavaModule::Unload);
 
     if (ConfigVariable::getScilabMode() != SCILAB_NWNI)
     {
@@ -425,7 +427,7 @@ bool FuncManager::StartModules()
     //excute .start file
     for (; it != itEnd; ++it)
     {
-        ExecuteStartFile(*it);
+        //ExecuteStartFile(*it);
     }
 
     return true;
index 3c210cc..097d284 100644 (file)
@@ -27,6 +27,6 @@ int JvmModule::Load()
     symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"system_getproperty", &sci_system_getproperty, MODULE_NAME));
     symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"system_setproperty", &sci_system_setproperty, MODULE_NAME));
     symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"javaclasspath", &sci_javaclasspath, MODULE_NAME));
-    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"javalibrarypath", &sci_javaclasspath, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"javalibrarypath", &sci_javalibrarypath, MODULE_NAME));
     return 1;
 }
index 2cb5b33..073b806 100644 (file)
@@ -80,7 +80,7 @@ begin
     ModulesXmlFileLines[i] := '<module name="m2sci" activate="yes"/>'; i := i + 1;
     ModulesXmlFileLines[i] := '<module name="mexlib" activate="yes"/>'; i := i + 1;
     ModulesXmlFileLines[i] := '<module name="sound" activate="yes"/>'; i := i + 1;
-    //ModulesXmlFileLines[i] := '<module name="external_objects" activate="yes"/>'; i := i + 1;
+    ModulesXmlFileLines[i] := '<module name="external_objects" activate="yes"/>'; i := i + 1;
     ModulesXmlFileLines[i] := '<module name="randlib" activate="yes"/>'; i := i + 1;
     ModulesXmlFileLines[i] := '<module name="demo_tools" activate="yes"/>'; i := i + 1;
     ModulesXmlFileLines[i] := '<module name="spreadsheet" activate="yes"/>'; i := i + 1;
@@ -115,7 +115,7 @@ begin
         ModulesXmlFileLines[i] := '<module name="graph" activate="yes"/>'; i := i + 1;
         ModulesXmlFileLines[i] := '<module name="javasci" activate="yes"/>'; i := i + 1;
         ModulesXmlFileLines[i] := '<module name="types" activate="yes"/>'; i := i + 1;
-        //ModulesXmlFileLines[i] := '<module name="external_objects_java" activate="yes"/>'; i := i + 1;
+        ModulesXmlFileLines[i] := '<module name="external_objects_java" activate="yes"/>'; i := i + 1;
     end;
 
     ModulesXmlFileLines[i] := '<!-- Scinotes dependencies -->'; i := i + 1;