all gw_*.c function check/alloc pvApiCtx. checkInputArgument store call name in recu... 75/6475/2
Antoine ELIAS [Mon, 27 Feb 2012 13:53:12 +0000 (14:53 +0100)]
Change-Id: I721ad00701cd6770ea924ce814f1101e840a0a38

78 files changed:
scilab/modules/action_binding/sci_gateway/c/gw_action_binding.c
scilab/modules/api_scilab/LibScilab_Import.def
scilab/modules/api_scilab/src/cpp/api_common.cpp
scilab/modules/arnoldi/arnoldi.vcxproj
scilab/modules/arnoldi/sci_gateway/c/gw_arnoldi.c
scilab/modules/boolean/sci_gateway/c/gw_boolean.c
scilab/modules/boolean/src/c/boolean.vcxproj
scilab/modules/cacsd/sci_gateway/c/gw_cacsd0.c
scilab/modules/cacsd/sci_gateway/c/gw_cacsd1.c
scilab/modules/cacsd/sci_gateway/c/gw_cacsd2.c
scilab/modules/cacsd/sci_gateway/c/gw_cacsd3.c
scilab/modules/cacsd/sci_gateway/c/gw_slicot.c
scilab/modules/cacsd/src/c/cacsd.vcxproj
scilab/modules/call_scilab/sci_gateway/c/gw_call_scilab.c
scilab/modules/completion/sci_gateway/c/gw_completion.c
scilab/modules/console/sci_gateway/c/gw_console.c
scilab/modules/core/sci_gateway/c/sci_error.c
scilab/modules/data_structures/sci_gateway/c/gw_data_structures1.c
scilab/modules/data_structures/sci_gateway/c/gw_data_structures2.c
scilab/modules/data_structures/src/c/data_structures.vcxproj
scilab/modules/differential_equations/sci_gateway/c/gw_differential_equations1.c
scilab/modules/differential_equations/sci_gateway/c/gw_differential_equations2.c
scilab/modules/differential_equations/sci_gateway/c/gw_differential_equations3.c
scilab/modules/differential_equations/sci_gateway/c/gw_differential_equations4.c
scilab/modules/differential_equations/sci_gateway/c/gw_differential_equations6.c
scilab/modules/differential_equations/src/c/LibScilab_Import.def
scilab/modules/differential_equations/src/c/differential_equations.vcxproj
scilab/modules/dynamic_link/sci_gateway/c/gw_dynamic_link.c
scilab/modules/dynamic_link/src/c/dynamic_link.vcxproj
scilab/modules/elementary_functions/sci_gateway/c/gw_elementary_functions.c
scilab/modules/fftw/fftw.vcxproj
scilab/modules/fftw/sci_gateway/c/gw_fftw.c
scilab/modules/functions/sci_gateway/c/gw_functions.c
scilab/modules/graphic_export/graphic_export.vcxproj
scilab/modules/graphic_export/sci_gateway/c/gw_graphic_export.c
scilab/modules/graphics/graphics.vcxproj
scilab/modules/graphics/sci_gateway/c/gw_graphics.c
scilab/modules/gui/sci_gateway/c/gw_gui.c
scilab/modules/helptools/sci_gateway/c/gw_helptools.c
scilab/modules/history_browser/sci_gateway/c/gw_history_browser.c
scilab/modules/history_browser/src/c/history_browser.vcxproj
scilab/modules/history_manager/sci_gateway/c/gw_history_manager.c
scilab/modules/integer/sci_gateway/c/gw_integer.c
scilab/modules/integer/src/c/integer.vcxproj
scilab/modules/interpolation/sci_gateway/c/gw_interpolation.c
scilab/modules/interpolation/src/c/interpolation.vcxproj
scilab/modules/jvm/sci_gateway/c/gw_jvm.c
scilab/modules/linear_algebra/sci_gateway/c/gw_linear_algebra.c
scilab/modules/linear_algebra/sci_gateway/c/gw_linear_algebra2.c
scilab/modules/linear_algebra/src/c/linear_algebra.vcxproj
scilab/modules/localization/sci_gateway/c/gw_localization.c
scilab/modules/matio/sci_gateway/c/gw_matio.c
scilab/modules/optimization/sci_gateway/c/gw_optimization.c
scilab/modules/optimization/src/c/optimization.vcxproj
scilab/modules/polynomials/sci_gateway/c/gw_polynomials.c
scilab/modules/polynomials/src/c/polynomials.vcxproj
scilab/modules/randlib/sci_gateway/c/gw_randlib.c
scilab/modules/randlib/src/c/randlib.vcxproj
scilab/modules/scicos/sci_gateway/c/gw_scicos.c
scilab/modules/scicos/src/c/scicos.vcxproj
scilab/modules/scinotes/sci_gateway/c/gw_scinotes.c
scilab/modules/signal_processing/sci_gateway/c/gw_signal.c
scilab/modules/sparse/sci_gateway/c/gw_sparse.c
scilab/modules/sparse/src/c/sparse.vcxproj
scilab/modules/special_functions/sci_gateway/c/gw_special_functions.c
scilab/modules/spreadsheet/sci_gateway/c/gw_spreadsheet.c
scilab/modules/spreadsheet/spreadsheet.vcxproj
scilab/modules/statistics/sci_gateway/c/gw_statistics.c
scilab/modules/statistics/src/c/statistics.vcxproj
scilab/modules/symbolic/sci_gateway/c/gw_symbolic.c
scilab/modules/symbolic/src/c/symbolic.vcxproj
scilab/modules/tclsci/sci_gateway/c/gw_tclsci.c
scilab/modules/tclsci/tclsci.vcxproj
scilab/modules/time/sci_gateway/c/gw_time.c
scilab/modules/ui_data/sci_gateway/c/gw_ui_data.c
scilab/modules/umfpack/sci_gateway/c/gw_umfpack.c
scilab/modules/umfpack/src/c/umfpack.vcxproj
scilab/modules/xcos/sci_gateway/c/gw_xcos.c

index 8a4dba2..a7a7ad2 100644 (file)
@@ -12,6 +12,7 @@
 /*--------------------------------------------------------------------------*/
 #include "gw_action_binding.h"
 #include "api_scilab.h"
+#include "MALLOC.h"
 #include "callFunctionFromGateway.h"
 /*--------------------------------------------------------------------------*/
 static gw_generic_table Tab[] = {
@@ -22,6 +23,12 @@ int gw_action_binding(void)
 {
        Rhs = Max(0, Rhs);
 
+       if(pvApiCtx == NULL)
+       {
+               pvApiCtx = (StrCtx*)MALLOC(sizeof(StrCtx));
+       }
+
+       pvApiCtx->pstName = (char*)Tab[Fin-1].name;
        callFunctionFromGateway(Tab,  SIZE_CURRENT_GENERIC_TABLE(Tab));
        return 0;
 }
index b1ebb20..e3d26d4 100644 (file)
@@ -35,6 +35,7 @@ extern "C"
 extern "C"
 {
     extern int C2F(cvnamel) (int *id, char *str, int *jobptr, int *str_len);
+    extern  int C2F(cvname)(int *,char *,int *, unsigned long int);
 /* *jobptr==0: Get Scilab codes from C-string */
 /* *jobptr==1: Get C-string from Scilab codes */
 
@@ -72,6 +73,14 @@ int checkInputArgument(void* _pvCtx, int _iMin, int _iMax)
     sciErr.iMsgCount = 0;
 
     int iRhs = InputArgument;
+
+    /*
+     * store the name in recu array, fname can be a non null terminated char array
+     * Get_Iname() can be used in other function to get the interface name
+     */
+    int cx0 = 0;
+    C2F(cvname) (&C2F(recu).ids[(C2F(recu).pt + 1) * nsiz - nsiz],  ((StrCtx *) _pvCtx)->pstName, &cx0, (unsigned long int)strlen(((StrCtx *)_pvCtx)->pstName));
+
     if(_iMin <= InputArgument && _iMax >= InputArgument)
     {
         return 1;
index ec569f7..ff8cdc6 100644 (file)
       <Project>{3170e4c2-1173-4264-a222-7ee8ccb3ddf7}</Project>
       <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
     </ProjectReference>
+    <ProjectReference Include="..\api_scilab\api_scilab.vcxproj">
+      <Project>{43c5bab1-1dca-4743-a183-77e0d42fe7d0}</Project>
+    </ProjectReference>
     <ProjectReference Include="..\output_stream\src\c\output_stream.vcxproj">
       <Project>{a5911cd7-f8e8-440c-a23e-4843a0636f3a}</Project>
       <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
index 808531d..da10ecc 100644 (file)
@@ -15,7 +15,8 @@
 #include <string.h>
 /*--------------------------------------------------------------------------*/
 #include "gw_arnoldi.h"
-#include "stack-c.h"
+#include "api_scilab.h"
+#include "MALLOC.h"
 #include "callFunctionFromGateway.h"
 /*--------------------------------------------------------------------------*/
 static gw_generic_table Tab[] = 
@@ -32,8 +33,13 @@ int gw_arnoldi(void)
 {
        Rhs = Max(0, Rhs);
 
-       callFunctionFromGateway(Tab, SIZE_CURRENT_GENERIC_TABLE(Tab));
+       if(pvApiCtx == NULL)
+       {
+               pvApiCtx = (StrCtx*)MALLOC(sizeof(StrCtx));
+       }
 
+       pvApiCtx->pstName = (char*)Tab[Fin-1].name;
+       callFunctionFromGateway(Tab, SIZE_CURRENT_GENERIC_TABLE(Tab));
        return 0;
 }
 /*--------------------------------------------------------------------------*/
index c4aac60..9cf78c1 100644 (file)
@@ -14,6 +14,8 @@
 /*--------------------------------------------------------------------------*/
 #include "gw_boolean.h"
 #include "callFunctionFromGateway.h"
+#include "api_scilab.h"
+#include "MALLOC.h"
 /*--------------------------------------------------------------------------*/
 static gw_generic_table Tab[] =
 {
@@ -25,6 +27,12 @@ static gw_generic_table Tab[] =
 /*--------------------------------------------------------------------------*/
 int gw_boolean(void)
 {  
+       if(pvApiCtx == NULL)
+       {
+               pvApiCtx = (StrCtx*)MALLOC(sizeof(StrCtx));
+       }
+
+       pvApiCtx->pstName = (char*)Tab[Fin-1].name;
        callFunctionFromGateway(Tab, SIZE_CURRENT_GENERIC_TABLE(Tab));
        return 0;
 }
index c945be4..fea13d8 100644 (file)
@@ -279,6 +279,9 @@ lib /DEF:"$(ProjectDir)boolean_f_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platf
       <Project>{3170e4c2-1173-4264-a222-7ee8ccb3ddf7}</Project>
       <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
     </ProjectReference>
+    <ProjectReference Include="..\..\..\api_scilab\api_scilab.vcxproj">
+      <Project>{43c5bab1-1dca-4743-a183-77e0d42fe7d0}</Project>
+    </ProjectReference>
     <ProjectReference Include="..\..\..\output_stream\src\c\output_stream.vcxproj">
       <Project>{a5911cd7-f8e8-440c-a23e-4843a0636f3a}</Project>
       <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
index a259796..d317b53 100644 (file)
@@ -17,6 +17,8 @@
 /*--------------------------------------------------------------------------*/
 #include "gw_cacsd0.h"
 #include "callFunctionFromGateway.h"
+#include "api_scilab.h"
+#include "MALLOC.h"
 /*--------------------------------------------------------------------------*/
 static gw_generic_table Tab[] =
 {
@@ -28,6 +30,12 @@ static gw_generic_table Tab[] =
 /*--------------------------------------------------------------------------*/
 int gw_cacsd0(void)
 {  
+       if(pvApiCtx == NULL)
+       {
+               pvApiCtx = (StrCtx*)MALLOC(sizeof(StrCtx));
+       }
+
+       pvApiCtx->pstName = (char*)Tab[Fin-1].name;
     callFunctionFromGateway(Tab, SIZE_CURRENT_GENERIC_TABLE(Tab));
     return 0;
 }
index adb6d97..e8937a5 100644 (file)
@@ -13,6 +13,8 @@
 /*--------------------------------------------------------------------------*/
 #include "gw_cacsd1.h"
 #include "callFunctionFromGateway.h"
+#include "api_scilab.h"
+#include "MALLOC.h"
 /*--------------------------------------------------------------------------*/
 static gw_generic_table Tab[] =
 {
@@ -23,6 +25,12 @@ static gw_generic_table Tab[] =
 /*--------------------------------------------------------------------------*/
 int gw_cacsd1(void)
 {  
+       if(pvApiCtx == NULL)
+       {
+               pvApiCtx = (StrCtx*)MALLOC(sizeof(StrCtx));
+       }
+
+       pvApiCtx->pstName = (char*)Tab[Fin-1].name;
        callFunctionFromGateway(Tab, SIZE_CURRENT_GENERIC_TABLE(Tab));
        return 0;
 }
index c97a475..290b854 100644 (file)
@@ -15,6 +15,7 @@
 /*--------------------------------------------------------------------------*/
 #include "gw_cacsd2.h"
 #include "callFunctionFromGateway.h"
+#include "api_scilab.h"
 #include "MALLOC.h"
 /*--------------------------------------------------------------------------*/
 static gw_generic_table Tab[]=
@@ -29,6 +30,12 @@ static gw_generic_table Tab[]=
 /*--------------------------------------------------------------------------*/
 int gw_cacsd2(void)
 {  
+       if(pvApiCtx == NULL)
+       {
+               pvApiCtx = (StrCtx*)MALLOC(sizeof(StrCtx));
+       }
+
+       pvApiCtx->pstName = (char*)Tab[Fin-1].name;
     callFunctionFromGateway(Tab, SIZE_CURRENT_GENERIC_TABLE(Tab));
     return 0;
 }
index f737b1f..66f28cc 100644 (file)
@@ -15,7 +15,8 @@
 /*--------------------------------------------------------------------------*/
 #include "gw_cacsd3.h"
 #include "callFunctionFromGateway.h"
-#include "stack-c.h"
+#include "api_scilab.h"
+#include "MALLOC.h"
 /*--------------------------------------------------------------------------*/
 static gw_generic_table Tab[] =
 {
@@ -27,6 +28,13 @@ static gw_generic_table Tab[] =
 int gw_cacsd3(void)
 {  
     if ( Fin-1 > 2) return 0;
+
+    if(pvApiCtx == NULL)
+       {
+               pvApiCtx = (StrCtx*)MALLOC(sizeof(StrCtx));
+       }
+
+       pvApiCtx->pstName = (char*)Tab[Fin-1].name;
     callFunctionFromGateway(Tab, SIZE_CURRENT_GENERIC_TABLE(Tab));
     return 0;
 }
index 2c5c5aa..7659b65 100644 (file)
@@ -25,6 +25,8 @@
 #include "sci_rankqr.h"
 #include "sci_contr.h"
 #include "gw_slicot.h"
+#include "api_scilab.h"
+#include "MALLOC.h"
 /*--------------------------------------------------------------------------*/ 
 #ifndef __DEF_MXARRAY__
 #define __DEF_MXARRAY__
@@ -57,7 +59,15 @@ static GenericTable Tab[]={
 int gw_slicot(void)
 {
        Rhs = Max(0, Rhs);
-       #ifdef _MSC_VER
+
+       if(pvApiCtx == NULL)
+       {
+               pvApiCtx = (StrCtx*)MALLOC(sizeof(StrCtx));
+       }
+
+       pvApiCtx->pstName = (char*)Tab[Fin-1].name;
+
+#ifdef _MSC_VER
                #ifndef _DEBUG
                _try
                {
index c61358f..a5c99fe 100644 (file)
@@ -251,6 +251,9 @@ lib /DEF:"$(ProjectDir)slicot_f_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platfo
       <Project>{3170e4c2-1173-4264-a222-7ee8ccb3ddf7}</Project>
       <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
     </ProjectReference>
+    <ProjectReference Include="..\..\..\api_scilab\api_scilab.vcxproj">
+      <Project>{43c5bab1-1dca-4743-a183-77e0d42fe7d0}</Project>
+    </ProjectReference>
     <ProjectReference Include="..\..\..\output_stream\src\c\output_stream.vcxproj">
       <Project>{a5911cd7-f8e8-440c-a23e-4843a0636f3a}</Project>
       <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
index 19b80bc..e516d6c 100644 (file)
@@ -11,7 +11,8 @@
  */
 #include <string.h>
 #include "gw_call_scilab.h"
-#include "stack-c.h"
+#include "api_scilab.h"
+#include "MALLOC.h"
 #include "callFunctionFromGateway.h"
 /*--------------------------------------------------------------------------*/
 static gw_generic_table Tab[] =
@@ -22,6 +23,12 @@ static gw_generic_table Tab[] =
 /*--------------------------------------------------------------------------*/
 int gw_call_scilab(void)
 {  
+       if(pvApiCtx == NULL)
+       {
+               pvApiCtx = (StrCtx*)MALLOC(sizeof(StrCtx));
+       }
+
+       pvApiCtx->pstName = (char*)Tab[Fin-1].name;
        callFunctionFromGateway(Tab, SIZE_CURRENT_GENERIC_TABLE(Tab));
        return 0;
 }
index ad1bd43..8105f6a 100644 (file)
@@ -11,7 +11,8 @@
  */
 #include <string.h>
 #include "gw_completion.h"
-#include "stack-c.h"
+#include "api_scilab.h"
+#include "MALLOC.h"
 #include "callFunctionFromGateway.h"
 /*--------------------------------------------------------------------------*/
 static gw_generic_table Tab[]=
@@ -22,8 +23,14 @@ static gw_generic_table Tab[]=
 int gw_completion(void)
 {  
        Rhs = Max(0, Rhs);
-       callFunctionFromGateway(Tab, SIZE_CURRENT_GENERIC_TABLE(Tab));
 
+       if(pvApiCtx == NULL)
+       {
+               pvApiCtx = (StrCtx*)MALLOC(sizeof(StrCtx));
+       }
+
+       pvApiCtx->pstName = (char*)Tab[Fin-1].name;
+    callFunctionFromGateway(Tab, SIZE_CURRENT_GENERIC_TABLE(Tab));
        return 0;
 }
 /*--------------------------------------------------------------------------*/
index e5c177f..8eee635 100644 (file)
@@ -13,6 +13,7 @@
 #include <string.h>
 #include "gw_console.h"
 #include "api_scilab.h"
+#include "MALLOC.h"
 #include "callFunctionFromGateway.h"
 /*--------------------------------------------------------------------------*/
 static gw_generic_table Tab[]=
@@ -27,7 +28,14 @@ static gw_generic_table Tab[]=
 int gw_console(void)
 {  
        Rhs = Max(0, Rhs);
-       callFunctionFromGateway(Tab,SIZE_CURRENT_GENERIC_TABLE(Tab));
+
+       if(pvApiCtx == NULL)
+       {
+               pvApiCtx = (StrCtx*)MALLOC(sizeof(StrCtx));
+       }
+
+       pvApiCtx->pstName = (char*)Tab[Fin-1].name;
+    callFunctionFromGateway(Tab,SIZE_CURRENT_GENERIC_TABLE(Tab));
        return 0;
 }
 /*--------------------------------------------------------------------------*/
index 481fe34..5e54a5f 100644 (file)
 #include "freeArrayOfString.h"
 #include "strsubst.h"
 #include "MALLOC.h"
+
+//#undef CheckRhs
+//#undef CheckLhs
+#include "stack-c.h"
 /*--------------------------------------------------------------------------*/
 #define defaultErrorCode 10000
 #define defaultErrorPosition 0
@@ -47,9 +51,13 @@ static void setErrorMessage(const char *fname,
     int iErrorPosition,
     const char **pMessages,
     int nbElements);
+
 /*--------------------------------------------------------------------------*/
 int C2F(sci_error)(char *fname, unsigned long fname_len)
 {
+    int in1 = 1, in2 = 2;
+
+    //C2F(checkrhs)(fname, &in1, &in2, 5);
     CheckRhs(1, 2);
     CheckLhs(1, 1);
 
index 3612c3b..b10dc98 100644 (file)
@@ -14,7 +14,8 @@
 #include <string.h>
 #include "gw_data_structures1.h"
 #include "callFunctionFromGateway.h"
-#include "stack-c.h"
+#include "api_scilab.h"
+#include "MALLOC.h"
 #include "Scierror.h"
 /*--------------------------------------------------------------------------*/
 static gw_generic_table Tab[]=
@@ -39,6 +40,12 @@ int gw_data_structures1(void)
                return 0;
        }
 
+       if(pvApiCtx == NULL)
+       {
+               pvApiCtx = (StrCtx*)MALLOC(sizeof(StrCtx));
+       }
+
+       pvApiCtx->pstName = (char*)Tab[Fin-1].name;
        callFunctionFromGateway(Tab, SIZE_CURRENT_GENERIC_TABLE(Tab));
        return 0;
 }
index 2c10f3b..7472918 100644 (file)
@@ -14,7 +14,8 @@
 #include <string.h>
 #include "gw_data_structures2.h"
 #include "callFunctionFromGateway.h"
-#include "stack-c.h"
+#include "api_scilab.h"
+#include "MALLOC.h"
 #include "Scierror.h"
 /*--------------------------------------------------------------------------*/
 static gw_generic_table Tab[] =
@@ -33,6 +34,12 @@ int gw_data_structures2(void)
                return 0;
        }
 
+       if(pvApiCtx == NULL)
+       {
+               pvApiCtx = (StrCtx*)MALLOC(sizeof(StrCtx));
+       }
+
+       pvApiCtx->pstName = (char*)Tab[Fin-1].name;
        callFunctionFromGateway(Tab, SIZE_CURRENT_GENERIC_TABLE(Tab));
        return 0;
 }
index b7e9119..d3b220c 100644 (file)
@@ -244,6 +244,9 @@ lib /DEF:"$(ProjectDir)data_structures_f_Import.def" /SUBSYSTEM:WINDOWS /MACHINE
       <Project>{3170e4c2-1173-4264-a222-7ee8ccb3ddf7}</Project>
       <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
     </ProjectReference>
+    <ProjectReference Include="..\..\..\api_scilab\api_scilab.vcxproj">
+      <Project>{43c5bab1-1dca-4743-a183-77e0d42fe7d0}</Project>
+    </ProjectReference>
     <ProjectReference Include="..\..\..\integer\src\c\integer.vcxproj">
       <Project>{c7865caa-ec7c-41eb-8324-2b81c384ca20}</Project>
       <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
index 82e448b..3208479 100644 (file)
@@ -15,6 +15,8 @@
 /*--------------------------------------------------------------------------*/
 #include "gw_differential_equations1.h"
 #include "callFunctionFromGateway.h"
+#include "api_scilab.h"
+#include "MALLOC.h"
 /*--------------------------------------------------------------------------*/
 static gw_generic_table Tab[] =
 {
@@ -23,6 +25,12 @@ static gw_generic_table Tab[] =
 /*--------------------------------------------------------------------------*/
 int gw_differential_equations1(void)
 {  
+       if(pvApiCtx == NULL)
+       {
+               pvApiCtx = (StrCtx*)MALLOC(sizeof(StrCtx));
+       }
+
+       pvApiCtx->pstName = (char*)Tab[Fin-1].name;
        callFunctionFromGateway(Tab, SIZE_CURRENT_GENERIC_TABLE(Tab));
        return 0;
 }
index a9a06ef..e276bfc 100644 (file)
@@ -15,6 +15,8 @@
 /*--------------------------------------------------------------------------*/
 #include "gw_differential_equations2.h"
 #include "callFunctionFromGateway.h"
+#include "api_scilab.h"
+#include "MALLOC.h"
 /*--------------------------------------------------------------------------*/
 static gw_generic_table Tab[]=
 {
@@ -26,6 +28,12 @@ static gw_generic_table Tab[]=
 /*--------------------------------------------------------------------------*/
 int gw_differential_equations2(void)
 {  
+       if(pvApiCtx == NULL)
+       {
+               pvApiCtx = (StrCtx*)MALLOC(sizeof(StrCtx));
+       }
+
+       pvApiCtx->pstName = (char*)Tab[Fin-1].name;
        callFunctionFromGateway(Tab, SIZE_CURRENT_GENERIC_TABLE(Tab));
        return 0;
 }
index a05bc87..8e47a68 100644 (file)
@@ -14,6 +14,8 @@
 #include <string.h>
 #include "gw_differential_equations3.h"
 #include "callFunctionFromGateway.h"
+#include "api_scilab.h"
+#include "MALLOC.h"
 /*--------------------------------------------------------------------------*/
 static gw_generic_table Tab[] =
 {
@@ -22,6 +24,12 @@ static gw_generic_table Tab[] =
 /*--------------------------------------------------------------------------*/
 int gw_differential_equations3(void)
 {  
+       if(pvApiCtx == NULL)
+       {
+               pvApiCtx = (StrCtx*)MALLOC(sizeof(StrCtx));
+       }
+
+       pvApiCtx->pstName = (char*)Tab[Fin-1].name;
        callFunctionFromGateway(Tab, SIZE_CURRENT_GENERIC_TABLE(Tab));
        return 0;
 }
index 58ef47e..b9c2429 100644 (file)
@@ -14,6 +14,8 @@
 #include <string.h>
 #include "gw_differential_equations4.h"
 #include "callFunctionFromGateway.h"
+#include "api_scilab.h"
+#include "MALLOC.h"
 /*--------------------------------------------------------------------------*/
 static gw_generic_table Tab[] =
 {
@@ -25,6 +27,12 @@ static gw_generic_table Tab[] =
 /*--------------------------------------------------------------------------*/
 int gw_differential_equations4(void)
 {  
+       if(pvApiCtx == NULL)
+       {
+               pvApiCtx = (StrCtx*)MALLOC(sizeof(StrCtx));
+       }
+
+       pvApiCtx->pstName = (char*)Tab[Fin-1].name;
        callFunctionFromGateway(Tab, SIZE_CURRENT_GENERIC_TABLE(Tab));
        return 0;
 }
index 7067e9b..f88ab49 100644 (file)
@@ -15,6 +15,8 @@
 /*--------------------------------------------------------------------------*/
 #include "gw_differential_equations6.h"
 #include "callFunctionFromGateway.h"
+#include "api_scilab.h"
+#include "MALLOC.h"
 /*--------------------------------------------------------------------------*/
 static gw_generic_table Tab[] =
 {
@@ -23,6 +25,12 @@ static gw_generic_table Tab[] =
 /*--------------------------------------------------------------------------*/
 int gw_differential_equations6(void)
 {  
+       if(pvApiCtx == NULL)
+       {
+               pvApiCtx = (StrCtx*)MALLOC(sizeof(StrCtx));
+       }
+
+       pvApiCtx->pstName = (char*)Tab[Fin-1].name;
        callFunctionFromGateway(Tab, SIZE_CURRENT_GENERIC_TABLE(Tab));
        return 0;
 }
index 3e3c9ef..1bf2b88 100644 (file)
@@ -6,4 +6,5 @@ EXPORTS
 ;core
 ;
 callFunctionFromGateway
-ierode_
\ No newline at end of file
+ierode_
+com_
\ No newline at end of file
index a84f02d..1b2f792 100644 (file)
@@ -252,6 +252,9 @@ lib /DEF:"$(ProjectDir)differential_equations_f_Import.def" /SUBSYSTEM:WINDOWS /
       <Project>{3170e4c2-1173-4264-a222-7ee8ccb3ddf7}</Project>
       <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
     </ProjectReference>
+    <ProjectReference Include="..\..\..\api_scilab\api_scilab.vcxproj">
+      <Project>{43c5bab1-1dca-4743-a183-77e0d42fe7d0}</Project>
+    </ProjectReference>
     <ProjectReference Include="..\..\..\dynamic_link\src\c\dynamic_link.vcxproj">
       <Project>{eab6c580-22b3-4359-ba1d-dd7499a96163}</Project>
       <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
index de9203e..d1467d7 100644 (file)
@@ -13,7 +13,8 @@
 /*--------------------------------------------------------------------------*/
 #include <string.h>
 #include "gw_dynamic_link.h"
-#include "stack-c.h"
+#include "api_scilab.h"
+#include "MALLOC.h"
 #include "callFunctionFromGateway.h"
 /*--------------------------------------------------------------------------*/
 static gw_generic_table Tab[] =
@@ -31,7 +32,14 @@ static gw_generic_table Tab[] =
 int gw_dynamic_link(void)
 {  
        Rhs = Max(0, Rhs);
-       callFunctionFromGateway(Tab, SIZE_CURRENT_GENERIC_TABLE(Tab));
+
+       if(pvApiCtx == NULL)
+       {
+               pvApiCtx = (StrCtx*)MALLOC(sizeof(StrCtx));
+       }
+
+       pvApiCtx->pstName = (char*)Tab[Fin-1].name;
+    callFunctionFromGateway(Tab, SIZE_CURRENT_GENERIC_TABLE(Tab));
        return 0;
 }
 /*--------------------------------------------------------------------------*/
index e7791f3..06da830 100644 (file)
@@ -250,6 +250,9 @@ lib /DEF:"$(ProjectDir)Scilab_Windows_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(
       <Project>{3170e4c2-1173-4264-a222-7ee8ccb3ddf7}</Project>
       <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
     </ProjectReference>
+    <ProjectReference Include="..\..\..\api_scilab\api_scilab.vcxproj">
+      <Project>{43c5bab1-1dca-4743-a183-77e0d42fe7d0}</Project>
+    </ProjectReference>
     <ProjectReference Include="..\..\..\fileio\fileio.vcxproj">
       <Project>{4fc72d4a-80ee-4b1a-8724-0201c1a35621}</Project>
       <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
index 11a1b5f..fcb22d6 100644 (file)
@@ -13,6 +13,9 @@
 #include "gw_elementary_functions.h"
 #include "callFunctionFromGateway.h"
 #include "recursionFunction.h"
+#include "api_scilab.h"
+#include "MALLOC.h"
+
 /*--------------------------------------------------------------------------*/
 static gw_generic_table Tab[] =
 {
@@ -73,7 +76,13 @@ static gw_generic_table Tab[] =
 };
 /*--------------------------------------------------------------------------*/
 int gw_elementary_functions(void)
-{  
+{
+       if(pvApiCtx == NULL)
+       {
+               pvApiCtx = (StrCtx*)MALLOC(sizeof(StrCtx));
+       }
+
+       pvApiCtx->pstName = (char*)Tab[Fin-1].name;
        callFunctionFromGateway(Tab, SIZE_CURRENT_GENERIC_TABLE(Tab));
        return 0;
 }
index d24b6f5..f4c9c58 100644 (file)
@@ -234,6 +234,9 @@ lib /DEF:"$(ProjectDir)Scilab_Windows_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(
     <ProjectReference Include="..\..\libs\MALLOC\MALLOC.vcxproj">
       <Project>{6a84ad8c-ba18-4a3f-9c72-ec3df0939e9e}</Project>
     </ProjectReference>
+    <ProjectReference Include="..\api_scilab\api_scilab.vcxproj">
+      <Project>{43c5bab1-1dca-4743-a183-77e0d42fe7d0}</Project>
+    </ProjectReference>
     <ProjectReference Include="..\localization\src\localization.vcxproj">
       <Project>{ecffeb0c-1eda-45ee-9a10-b18143852e17}</Project>
     </ProjectReference>
index 3519aa4..2a36e4f 100644 (file)
@@ -17,7 +17,8 @@
 #include "gw_fftw.h"
 #include "callFunctionFromGateway.h"
 #include "localization.h"
-#include "stack-c.h"
+#include "api_scilab.h"
+#include "MALLOC.h"
 /*--------------------------------------------------------------------------*/ 
 static gw_generic_table Tab[] = 
 {
@@ -56,6 +57,12 @@ int gw_fftw(void)
                }
        }
 
+       if(pvApiCtx == NULL)
+       {
+               pvApiCtx = (StrCtx*)MALLOC(sizeof(StrCtx));
+       }
+
+       pvApiCtx->pstName = (char*)Tab[Fin-1].name;
        callFunctionFromGateway(Tab,SIZE_CURRENT_GENERIC_TABLE(Tab));
 
        return 0;
index 376142f..a2bd43a 100644 (file)
@@ -13,7 +13,8 @@
 
 
 #include "gw_functions.h"
-#include "stack-c.h"
+#include "api_scilab.h"
+#include "MALLOC.h"
 #include "callFunctionFromGateway.h"
 #include "recursionFunction.h"
 /*--------------------------------------------------------------------------*/
@@ -64,6 +65,12 @@ int gw_functions(void)
                }
        }
        
+       if(pvApiCtx == NULL)
+       {
+               pvApiCtx = (StrCtx*)MALLOC(sizeof(StrCtx));
+       }
+
+       pvApiCtx->pstName = (char*)Tab[Fin-1].name;
        callFunctionFromGateway(Tab, SIZE_CURRENT_GENERIC_TABLE(Tab));
        return 0;
 }
index 99a0f0a..a8d4f38 100644 (file)
@@ -259,6 +259,9 @@ lib /DEF:"$(ProjectDir)renderer_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platfo
       <Project>{3170e4c2-1173-4264-a222-7ee8ccb3ddf7}</Project>
       <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
     </ProjectReference>
+    <ProjectReference Include="..\api_scilab\api_scilab.vcxproj">
+      <Project>{43c5bab1-1dca-4743-a183-77e0d42fe7d0}</Project>
+    </ProjectReference>
     <ProjectReference Include="..\commons\src\c\commons.vcxproj">
       <Project>{eca09a1e-6d12-4a47-92e1-a671c181df77}</Project>
     </ProjectReference>
index 9d241a0..0cd8a30 100644 (file)
@@ -14,7 +14,8 @@
 
 #include <string.h>
 #include "gw_graphic_export.h"
-#include "stack-c.h"
+#include "api_scilab.h"
+#include "MALLOC.h"
 #include "scilabmode.h"
 #include "callFunctionFromGateway.h"
 #include "localization.h"
@@ -41,7 +42,15 @@ static gw_generic_table Tab[] =
 int gw_graphic_export(void)
 {  
        Rhs = Max(0, Rhs);
-       if ( getScilabMode() != SCILAB_NWNI )
+
+       if(pvApiCtx == NULL)
+       {
+               pvApiCtx = (StrCtx*)MALLOC(sizeof(StrCtx));
+       }
+
+       pvApiCtx->pstName = (char*)Tab[Fin-1].name;
+
+    if ( getScilabMode() != SCILAB_NWNI )
        {
                if (!loadedDep) 
                {
index 44d4005..4bb5483 100644 (file)
@@ -658,6 +658,9 @@ lib /DEF:"$(ProjectDir)scilab_windows_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(
       <Project>{8a654cc5-22c1-4972-a8cf-1b89f78b5383}</Project>
       <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
     </ProjectReference>
+    <ProjectReference Include="..\api_scilab\api_scilab.vcxproj">
+      <Project>{43c5bab1-1dca-4743-a183-77e0d42fe7d0}</Project>
+    </ProjectReference>
     <ProjectReference Include="..\fileio\fileio.vcxproj">
       <Project>{4fc72d4a-80ee-4b1a-8724-0201c1a35621}</Project>
       <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
index c94df1d..98da968 100644 (file)
@@ -13,7 +13,8 @@
 
 /*--------------------------------------------------------------------------*/ 
 #include "gw_graphics.h"
-#include "stack-c.h"
+#include "api_scilab.h"
+#include "MALLOC.h"
 #include "scilabmode.h"
 #include "localization.h"
 #include "Scierror.h"
@@ -104,6 +105,12 @@ int gw_graphics(void)
 {  
        Rhs = Max(0, Rhs);
 
+       if(pvApiCtx == NULL)
+       {
+               pvApiCtx = (StrCtx*)MALLOC(sizeof(StrCtx));
+       }
+
+       pvApiCtx->pstName = (char*)Tab[Fin-1].name;
        if ( getScilabMode() != SCILAB_NWNI )
        {
                if (!loadedDep) 
index 65b4bba..8db313d 100644 (file)
@@ -13,7 +13,8 @@
 
 #include <string.h>
 #include "gw_gui.h"
-#include "stack-c.h"
+#include "api_scilab.h"
+#include "MALLOC.h"
 #include "scilabmode.h"
 #include "callFunctionFromGateway.h"
 #include "localization.h"
@@ -90,6 +91,12 @@ int gw_gui(void)
           }
 
 
+       if(pvApiCtx == NULL)
+       {
+               pvApiCtx = (StrCtx*)MALLOC(sizeof(StrCtx));
+       }
+
+       pvApiCtx->pstName = (char*)Tab[Fin-1].name;
        callFunctionFromGateway(Tab, SIZE_CURRENT_GENERIC_TABLE(Tab));
 
        return 0;
index 58833a5..bf8d625 100644 (file)
@@ -12,7 +12,8 @@
 /*--------------------------------------------------------------------------*/
 #include <string.h>
 #include "gw_helptools.h"
-#include "stack-c.h"
+#include "api_scilab.h"
+#include "MALLOC.h"
 #include "scilabmode.h"
 #include "callFunctionFromGateway.h"
 #include "localization.h"
@@ -44,6 +45,12 @@ int gw_helptools(void)
         loadedDep = TRUE;
     }
 
+       if(pvApiCtx == NULL)
+       {
+               pvApiCtx = (StrCtx*)MALLOC(sizeof(StrCtx));
+       }
+
+       pvApiCtx->pstName = (char*)Tab[Fin-1].name;
     callFunctionFromGateway(Tab, SIZE_CURRENT_GENERIC_TABLE(Tab));
 
     return 0;
index 4049bf6..8517b4e 100644 (file)
@@ -18,7 +18,8 @@
 /*--------------------------------------------------------------------------*/
 #include <string.h>
 #include "gw_history_browser.h"
-#include "stack-c.h"
+#include "api_scilab.h"
+#include "MALLOC.h"
 #include "callFunctionFromGateway.h"
 /*--------------------------------------------------------------------------*/
 static gw_generic_table Tab[] =
@@ -29,6 +30,13 @@ static gw_generic_table Tab[] =
 int gw_history_browser(void)
 {
        Rhs = Max(0, Rhs);
+
+    if(pvApiCtx == NULL)
+       {
+               pvApiCtx = (StrCtx*)MALLOC(sizeof(StrCtx));
+       }
+
+       pvApiCtx->pstName = (char*)Tab[Fin-1].name;
        callFunctionFromGateway(Tab, SIZE_CURRENT_GENERIC_TABLE(Tab));
        return 0;
 }
index 00607b8..5576a47 100644 (file)
     <None Include="..\..\Makefile.am" />
   </ItemGroup>
   <ItemGroup>
+    <ProjectReference Include="..\..\..\..\libs\MALLOC\MALLOC.vcxproj">
+      <Project>{6a84ad8c-ba18-4a3f-9c72-ec3df0939e9e}</Project>
+    </ProjectReference>
+    <ProjectReference Include="..\..\..\api_scilab\api_scilab.vcxproj">
+      <Project>{43c5bab1-1dca-4743-a183-77e0d42fe7d0}</Project>
+    </ProjectReference>
     <ProjectReference Include="..\..\..\commons\src\c\commons.vcxproj">
       <Project>{eca09a1e-6d12-4a47-92e1-a671c181df77}</Project>
     </ProjectReference>
index 57ffc3d..204b313 100644 (file)
@@ -19,6 +19,7 @@
 #include <string.h>
 #include "gw_history_manager.h"
 #include "api_scilab.h"
+#include "MALLOC.h"
 #include "callFunctionFromGateway.h"
 /*--------------------------------------------------------------------------*/
 static gw_generic_table Tab[] =
@@ -41,6 +42,13 @@ static gw_generic_table Tab[] =
 int gw_history_manager(void)
 {
        Rhs = Max(0, Rhs);
+
+    if(pvApiCtx == NULL)
+       {
+               pvApiCtx = (StrCtx*)MALLOC(sizeof(StrCtx));
+       }
+
+       pvApiCtx->pstName = (char*)Tab[Fin-1].name;
        callFunctionFromGateway(Tab, SIZE_CURRENT_GENERIC_TABLE(Tab));
        return 0;
 }
index b3ec17a..0e8eb28 100644 (file)
@@ -14,7 +14,8 @@
 /*--------------------------------------------------------------------------*/
 #include <string.h>
 #include "gw_integer.h"
-#include "stack-c.h"
+#include "api_scilab.h"
+#include "MALLOC.h"
 #include "callFunctionFromGateway.h"
 /*--------------------------------------------------------------------------*/
 #ifdef _MSC_VER
@@ -58,21 +59,28 @@ static gw_generic_table Tab[]=
 /*--------------------------------------------------------------------------*/
 int gw_integer(void)
 {  
-       #ifdef _MSC_VER
-       #ifndef _DEBUG
-       if  ( BuildWithVS8ExpressF2C() )
+    if(pvApiCtx == NULL)
        {
-               /* Bug 4123 F2C code (i_prod.f) returns a wrong exception after callFunctionFromGateway */
-               /* and it crashs with release mode */
-               /* workaround disabled callFunctionFromGateway and call function without check */
-               if (*(Tab[Fin-1].f) != NULL) (*(Tab[Fin-1].f)) ((char*)Tab[Fin-1].name,(unsigned long)strlen(Tab[Fin-1].name));
-       }
-       else
-       #endif
-       #endif
-       {
-               callFunctionFromGateway(Tab, SIZE_CURRENT_GENERIC_TABLE(Tab));
+               pvApiCtx = (StrCtx*)MALLOC(sizeof(StrCtx));
        }
+
+       pvApiCtx->pstName = (char*)Tab[Fin-1].name;
+
+#ifdef _MSC_VER
+#ifndef _DEBUG
+    if  ( BuildWithVS8ExpressF2C() )
+    {
+        /* Bug 4123 F2C code (i_prod.f) returns a wrong exception after callFunctionFromGateway */
+        /* and it crashs with release mode */
+        /* workaround disabled callFunctionFromGateway and call function without check */
+        if (*(Tab[Fin-1].f) != NULL) (*(Tab[Fin-1].f)) ((char*)Tab[Fin-1].name,(unsigned long)strlen(Tab[Fin-1].name));
+    }
+    else
+#endif
+#endif
+    {
+        callFunctionFromGateway(Tab, SIZE_CURRENT_GENERIC_TABLE(Tab));
+    }
        return 0;
 }
 /*--------------------------------------------------------------------------*/
index f9b6d1e..8505035 100644 (file)
@@ -311,6 +311,9 @@ lib /DEF:"$(ProjectDir)Polynomials_f_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(P
       <Project>{3170e4c2-1173-4264-a222-7ee8ccb3ddf7}</Project>
       <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
     </ProjectReference>
+    <ProjectReference Include="..\..\..\api_scilab\api_scilab.vcxproj">
+      <Project>{43c5bab1-1dca-4743-a183-77e0d42fe7d0}</Project>
+    </ProjectReference>
     <ProjectReference Include="..\..\..\output_stream\src\c\output_stream.vcxproj">
       <Project>{a5911cd7-f8e8-440c-a23e-4843a0636f3a}</Project>
       <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
index d70efd4..b417f36 100644 (file)
@@ -13,7 +13,8 @@
 #include <string.h>
 #include "gw_interpolation.h"
 #include "callFunctionFromGateway.h"
-#include "stack-c.h"
+#include "api_scilab.h"
+#include "MALLOC.h"
 /*--------------------------------------------------------------------------*/
 static gw_generic_table Tab[] = 
 { 
@@ -33,6 +34,13 @@ static gw_generic_table Tab[] =
 int gw_interpolation(void)
 {
        Rhs = Max(0, Rhs);
+
+    if(pvApiCtx == NULL)
+       {
+               pvApiCtx = (StrCtx*)MALLOC(sizeof(StrCtx));
+       }
+
+       pvApiCtx->pstName = (char*)Tab[Fin-1].name;
        callFunctionFromGateway(Tab,SIZE_CURRENT_GENERIC_TABLE(Tab));
        return 0;
 }
index 0a32d16..92d53bc 100644 (file)
@@ -234,6 +234,9 @@ lib /DEF:"$(ProjectDir)interpolation_f_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$
       <Project>{3170e4c2-1173-4264-a222-7ee8ccb3ddf7}</Project>
       <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
     </ProjectReference>
+    <ProjectReference Include="..\..\..\api_scilab\api_scilab.vcxproj">
+      <Project>{43c5bab1-1dca-4743-a183-77e0d42fe7d0}</Project>
+    </ProjectReference>
     <ProjectReference Include="..\..\..\localization\src\localization.vcxproj">
       <Project>{ecffeb0c-1eda-45ee-9a10-b18143852e17}</Project>
       <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
index db02fd9..1c987ce 100644 (file)
@@ -14,6 +14,7 @@
 #include <string.h>
 #include "gw_jvm.h"
 #include "api_scilab.h"
+#include "MALLOC.h"
 #include "scilabmode.h"
 #include "Scierror.h"
 #include "callFunctionFromGateway.h"
@@ -32,6 +33,12 @@ int gw_jvm(void)
 {  
        Rhs = Max(0, Rhs);
 
+    if(pvApiCtx == NULL)
+       {
+               pvApiCtx = (StrCtx*)MALLOC(sizeof(StrCtx));
+       }
+
+       pvApiCtx->pstName = (char*)Tab[Fin-1].name;
        if ( (getScilabMode() != SCILAB_NWNI) )
        {
                callFunctionFromGateway(Tab, SIZE_CURRENT_GENERIC_TABLE(Tab));  
index cf1134f..5015e20 100644 (file)
@@ -12,7 +12,8 @@
  */
 
 #include <string.h>
-#include "stack-c.h"
+#include "api_scilab.h"
+#include "MALLOC.h"
 #include "gw_linear_algebra.h"
 #include "callFunctionFromGateway.h"
 /*--------------------------------------------------------------------------*/ 
@@ -34,6 +35,13 @@ static gw_generic_table Tab[] =
 int gw_linear_algebra(void)
 {  
        Rhs = Max(0, Rhs);
+
+    if(pvApiCtx == NULL)
+       {
+               pvApiCtx = (StrCtx*)MALLOC(sizeof(StrCtx));
+       }
+
+       pvApiCtx->pstName = (char*)Tab[Fin-1].name;
        callFunctionFromGateway(Tab, SIZE_CURRENT_GENERIC_TABLE(Tab));
        PutLhsVar();
        return 0;
index 8455e8d..b4d6490 100644 (file)
@@ -15,7 +15,8 @@
 #include "gw_linear_algebra.h"
 #include "gw_linear_algebra2.h"
 #include "callFunctionFromGateway.h"
-#include "stack-c.h"
+#include "api_scilab.h"
+#include "MALLOC.h"
 /*--------------------------------------------------------------------------*/ 
 static gw_generic_table Tab[] = 
 {
@@ -38,6 +39,13 @@ static gw_generic_table Tab[] =
 int gw_linear_algebra2(void)
 {  
        Rhs = Max(0, Rhs);
+
+    if(pvApiCtx == NULL)
+       {
+               pvApiCtx = (StrCtx*)MALLOC(sizeof(StrCtx));
+       }
+
+       pvApiCtx->pstName = (char*)Tab[Fin-1].name;
        callFunctionFromGateway(Tab, SIZE_CURRENT_GENERIC_TABLE(Tab));
        if (Err <= 0 && C2F(errgst).err1 <= 0) PutLhsVar();
        return 0;
index e0b8ba1..5e8b903 100644 (file)
@@ -255,6 +255,9 @@ lib /DEF:"$(ProjectDir)linear_algebra_f_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:
       <Project>{3170e4c2-1173-4264-a222-7ee8ccb3ddf7}</Project>
       <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
     </ProjectReference>
+    <ProjectReference Include="..\..\..\api_scilab\api_scilab.vcxproj">
+      <Project>{43c5bab1-1dca-4743-a183-77e0d42fe7d0}</Project>
+    </ProjectReference>
     <ProjectReference Include="..\..\..\dynamic_link\src\c\dynamic_link.vcxproj">
       <Project>{eab6c580-22b3-4359-ba1d-dd7499a96163}</Project>
       <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
index 8aa2da3..9d55602 100644 (file)
@@ -13,6 +13,7 @@
 #include <string.h>
 #include "gw_localization.h"
 #include "api_scilab.h"
+#include "MALLOC.h"
 #include "callFunctionFromGateway.h"
 /*--------------------------------------------------------------------------*/ 
 static gw_generic_table Tab[]=
@@ -28,6 +29,13 @@ static gw_generic_table Tab[]=
 int gw_localization(void)
 {  
        Rhs = Max(0, Rhs);
+
+    if(pvApiCtx == NULL)
+       {
+               pvApiCtx = (StrCtx*)MALLOC(sizeof(StrCtx));
+       }
+
+       pvApiCtx->pstName = (char*)Tab[Fin-1].name;
        callFunctionFromGateway(Tab, SIZE_CURRENT_GENERIC_TABLE(Tab));
        return 0;
 }
index dfebdc5..5e83921 100644 (file)
@@ -16,6 +16,7 @@
 /*-----------------------------------------------------------------------------------*/ 
 #include "gw_matio.h"
 #include "api_scilab.h"
+#include "MALLOC.h"
 #include "callFunctionFromGateway.h"
 /*-----------------------------------------------------------------------------------*/ 
 int gw_matio(void);
@@ -32,6 +33,13 @@ static gw_generic_table Tab[] =
 int gw_matio(void)
 {
        Rhs = Max(0, Rhs);
+
+    if(pvApiCtx == NULL)
+       {
+               pvApiCtx = (StrCtx*)MALLOC(sizeof(StrCtx));
+       }
+
+       pvApiCtx->pstName = (char*)Tab[Fin-1].name;
        callFunctionFromGateway(Tab, SIZE_CURRENT_GENERIC_TABLE(Tab));
        return 0;
 }
index 08c6073..f4644c2 100644 (file)
@@ -12,7 +12,8 @@
 /*--------------------------------------------------------------------------*/
 #include <string.h>
 #include "gw_optimization.h"
-#include "stack-c.h"
+#include "api_scilab.h"
+#include "MALLOC.h"
 #include "callFunctionFromGateway.h"
 /*--------------------------------------------------------------------------*/
 static gw_generic_table Tab[] =
@@ -29,6 +30,13 @@ static gw_generic_table Tab[] =
 int gw_optimization(void)
 {  
        Rhs = Max(0, Rhs);
+
+    if(pvApiCtx == NULL)
+       {
+               pvApiCtx = (StrCtx*)MALLOC(sizeof(StrCtx));
+       }
+
+       pvApiCtx->pstName = (char*)Tab[Fin-1].name;
        callFunctionFromGateway(Tab, SIZE_CURRENT_GENERIC_TABLE(Tab));
        return 0;
 }
index fa7f9fa..9bbe900 100644 (file)
@@ -234,6 +234,9 @@ lib /DEF:"$(ProjectDir)optimization_f_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(
       <Project>{3170e4c2-1173-4264-a222-7ee8ccb3ddf7}</Project>
       <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
     </ProjectReference>
+    <ProjectReference Include="..\..\..\api_scilab\api_scilab.vcxproj">
+      <Project>{43c5bab1-1dca-4743-a183-77e0d42fe7d0}</Project>
+    </ProjectReference>
     <ProjectReference Include="..\..\..\dynamic_link\src\c\dynamic_link.vcxproj">
       <Project>{eab6c580-22b3-4359-ba1d-dd7499a96163}</Project>
       <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
index 8a281ec..e6a4fbb 100644 (file)
@@ -14,6 +14,8 @@
 
 #include "gw_polynomials.h"
 #include "callFunctionFromGateway.h"
+#include "api_scilab.h"
+#include "MALLOC.h"
 /*--------------------------------------------------------------------------*/
 static int sci_notused(char *fname,unsigned long fname_len)
 {
@@ -45,6 +47,13 @@ static gw_generic_table Tab[] =
 int gw_polynomials(void)
 {
        callFunctionFromGateway(Tab, SIZE_CURRENT_GENERIC_TABLE(Tab));
+
+    if(pvApiCtx == NULL)
+       {
+               pvApiCtx = (StrCtx*)MALLOC(sizeof(StrCtx));
+       }
+
+       pvApiCtx->pstName = (char*)Tab[Fin-1].name;
        return 0;
 }
 /*--------------------------------------------------------------------------*/
index 4e5385d..d7bc505 100644 (file)
@@ -233,6 +233,9 @@ lib /DEF:"$(ProjectDir)polynomials_f_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(P
       <Project>{3170e4c2-1173-4264-a222-7ee8ccb3ddf7}</Project>
       <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
     </ProjectReference>
+    <ProjectReference Include="..\..\..\api_scilab\api_scilab.vcxproj">
+      <Project>{43c5bab1-1dca-4743-a183-77e0d42fe7d0}</Project>
+    </ProjectReference>
   </ItemGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
index 52b25f5..4f29c6e 100644 (file)
@@ -17,7 +17,8 @@
 /*--------------------------------------------------------------------------*/
 #include <string.h>
 #include "gw_randlib.h"
-#include "stack-c.h"
+#include "api_scilab.h"
+#include "MALLOC.h"
 #include "callFunctionFromGateway.h"
 /*--------------------------------------------------------------------------*/
 static gw_generic_table Tab[]={ 
@@ -27,6 +28,13 @@ static gw_generic_table Tab[]={
 int gw_randlib(void)
 {
        Rhs = Max(0, Rhs);
+
+    if(pvApiCtx == NULL)
+       {
+               pvApiCtx = (StrCtx*)MALLOC(sizeof(StrCtx));
+       }
+
+       pvApiCtx->pstName = (char*)Tab[Fin-1].name;
        callFunctionFromGateway(Tab,SIZE_CURRENT_GENERIC_TABLE(Tab));
        return 0;
 }
index f8309d2..1827cfc 100644 (file)
@@ -227,10 +227,16 @@ lib /DEF:"$(ProjectDir)randlib_f_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platf
     <ResourceCompile Include="randlib.rc" />
   </ItemGroup>
   <ItemGroup>
+    <ProjectReference Include="..\..\..\..\libs\MALLOC\MALLOC.vcxproj">
+      <Project>{6a84ad8c-ba18-4a3f-9c72-ec3df0939e9e}</Project>
+    </ProjectReference>
     <ProjectReference Include="..\..\..\..\tools\Dumpexts\Dumpexts.vcxproj">
       <Project>{3170e4c2-1173-4264-a222-7ee8ccb3ddf7}</Project>
       <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
     </ProjectReference>
+    <ProjectReference Include="..\..\..\api_scilab\api_scilab.vcxproj">
+      <Project>{43c5bab1-1dca-4743-a183-77e0d42fe7d0}</Project>
+    </ProjectReference>
     <ProjectReference Include="..\..\..\localization\src\localization.vcxproj">
       <Project>{ecffeb0c-1eda-45ee-9a10-b18143852e17}</Project>
       <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
index 3a7b3d1..aea96ec 100644 (file)
@@ -24,7 +24,8 @@
 /*--------------------------------------------------------------------------*/
 #include <string.h>
 #include "gw_scicos.h"
-#include "stack-c.h"
+#include "api_scilab.h"
+#include "MALLOC.h"
 #include "callFunctionFromGateway.h"
 
 
@@ -68,6 +69,13 @@ static gw_generic_table Tab[] =
 int gw_scicos(void)
 {
        Rhs = Max(0, Rhs);
+
+    if(pvApiCtx == NULL)
+       {
+               pvApiCtx = (StrCtx*)MALLOC(sizeof(StrCtx));
+       }
+
+       pvApiCtx->pstName = (char*)Tab[Fin-1].name;
        callFunctionFromGateway(Tab, SIZE_CURRENT_GENERIC_TABLE(Tab));
        return 0;
 }
index eec8e24..f159cb8 100644 (file)
@@ -352,6 +352,9 @@ lib /DEF:"$(ProjectDir)Localization_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Pl
       <Project>{3170e4c2-1173-4264-a222-7ee8ccb3ddf7}</Project>
       <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
     </ProjectReference>
+    <ProjectReference Include="..\..\..\api_scilab\api_scilab.vcxproj">
+      <Project>{43c5bab1-1dca-4743-a183-77e0d42fe7d0}</Project>
+    </ProjectReference>
     <ProjectReference Include="..\..\..\elementary_functions\src\c\elementary_functions.vcxproj">
       <Project>{5b110267-7c18-437c-b87d-dba2b50729e9}</Project>
       <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
index 34a88be..3ba9648 100644 (file)
  */
 /*--------------------------------------------------------------------------*/
 #include "gw_scinotes.h"
-#include "stack-c.h"
+#include "api_scilab.h"
+#include "MALLOC.h"
 #include "callFunctionFromGateway.h"
 #include "BOOL.h"
 #include "scilabmode.h"
 #include "localization.h"
 #include "Scierror.h"
-#include "BOOL.h"
 #include "loadOnUseClassPath.h"
 /*--------------------------------------------------------------------------*/
 static BOOL loadedDep = FALSE;
@@ -43,6 +43,13 @@ int gw_scinotes(void)
         loadOnUseClassPath("SciNotes");
         loadedDep = TRUE;
     }
+
+    if(pvApiCtx == NULL)
+       {
+               pvApiCtx = (StrCtx*)MALLOC(sizeof(StrCtx));
+       }
+
+       pvApiCtx->pstName = (char*)Tab[Fin-1].name;
     callFunctionFromGateway(Tab, SIZE_CURRENT_GENERIC_TABLE(Tab));
     return 0;
 }
index 53967ff..e947ea2 100644 (file)
@@ -13,6 +13,8 @@
 #include <string.h>
 #include "gw_signal.h"
 #include "callFunctionFromGateway.h"
+#include "api_scilab.h"
+#include "MALLOC.h"
 /*--------------------------------------------------------------------------*/
 static gw_generic_table Tab[]=
 {
@@ -31,6 +33,12 @@ static gw_generic_table Tab[]=
 /*--------------------------------------------------------------------------*/
 int gw_signal_processing(void)
 {  
+    if(pvApiCtx == NULL)
+       {
+               pvApiCtx = (StrCtx*)MALLOC(sizeof(StrCtx));
+       }
+
+       pvApiCtx->pstName = (char*)Tab[Fin-1].name;
        callFunctionFromGateway(Tab, SIZE_CURRENT_GENERIC_TABLE(Tab));
        return 0;
 }
index c32cefe..5083598 100644 (file)
@@ -14,6 +14,8 @@
 #include <string.h>
 #include "gw_sparse.h"
 #include "callFunctionFromGateway.h"
+#include "api_scilab.h"
+#include "MALLOC.h"
 /*--------------------------------------------------------------------------*/
 static gw_generic_table Tab[]=
 {
@@ -47,6 +49,12 @@ static gw_generic_table Tab[]=
 /*--------------------------------------------------------------------------*/
 int gw_sparse(void)
 {  
+    if(pvApiCtx == NULL)
+       {
+               pvApiCtx = (StrCtx*)MALLOC(sizeof(StrCtx));
+       }
+
+       pvApiCtx->pstName = (char*)Tab[Fin-1].name;
     callFunctionFromGateway(Tab, SIZE_CURRENT_GENERIC_TABLE(Tab));
     return 0;
 }
index b50456d..624d0f9 100644 (file)
@@ -267,6 +267,9 @@ lib /DEF:"$(ProjectDir)sparse_f_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platfo
       <Project>{3170e4c2-1173-4264-a222-7ee8ccb3ddf7}</Project>
       <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
     </ProjectReference>
+    <ProjectReference Include="..\..\..\api_scilab\api_scilab.vcxproj">
+      <Project>{43c5bab1-1dca-4743-a183-77e0d42fe7d0}</Project>
+    </ProjectReference>
     <ProjectReference Include="..\..\..\elementary_functions\src\c\elementary_functions.vcxproj">
       <Project>{5b110267-7c18-437c-b87d-dba2b50729e9}</Project>
       <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
index b3210b0..3628429 100644 (file)
@@ -14,7 +14,8 @@
 /*--------------------------------------------------------------------------*/
 #include "gw_special_functions.h"
 #include "callFunctionFromGateway.h"
-#include "stack-c.h"
+#include "api_scilab.h"
+#include "MALLOC.h"
 #include "xerhlt.h"
 #include "Scierror.h"
 /*--------------------------------------------------------------------------*/
@@ -40,6 +41,13 @@ int gw_special_functions(void)
         Scierror(999,"%s: Wrong value for input argument: Positive expected.\n", Tab[Fin-1].name);
         return 0;
     }
+
+    if(pvApiCtx == NULL)
+       {
+               pvApiCtx = (StrCtx*)MALLOC(sizeof(StrCtx));
+       }
+
+       pvApiCtx->pstName = (char*)Tab[Fin-1].name;
     callFunctionFromGateway(Tab, SIZE_CURRENT_GENERIC_TABLE(Tab));
     return 0;
 }
index be3b71a..f8a8f9c 100644 (file)
@@ -13,7 +13,8 @@
 
 #include <string.h>
 #include "gw_spreadsheet.h"
-#include "stack-c.h"
+#include "api_scilab.h"
+#include "MALLOC.h"
 #include "callFunctionFromGateway.h"
 /*--------------------------------------------------------------------------*/ 
 static gw_generic_table Tab[] = 
@@ -25,6 +26,13 @@ static gw_generic_table Tab[] =
 int gw_spreadsheet(void)
 {  
        Rhs = Max(0, Rhs);
+
+    if(pvApiCtx == NULL)
+       {
+               pvApiCtx = (StrCtx*)MALLOC(sizeof(StrCtx));
+       }
+
+       pvApiCtx->pstName = (char*)Tab[Fin-1].name;
        callFunctionFromGateway(Tab, SIZE_CURRENT_GENERIC_TABLE(Tab));
        return 0;
 }
index 24b937d..83fe1f2 100644 (file)
       <Project>{6a84ad8c-ba18-4a3f-9c72-ec3df0939e9e}</Project>
       <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
     </ProjectReference>
+    <ProjectReference Include="..\api_scilab\api_scilab.vcxproj">
+      <Project>{43c5bab1-1dca-4743-a183-77e0d42fe7d0}</Project>
+    </ProjectReference>
     <ProjectReference Include="..\fileio\fileio.vcxproj">
       <Project>{4fc72d4a-80ee-4b1a-8724-0201c1a35621}</Project>
       <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
index 3c2ac2c..bc33bf3 100644 (file)
@@ -12,7 +12,8 @@
 /*--------------------------------------------------------------------------*/
 #include <string.h>
 #include "gw_statistics.h"
-#include "stack-c.h"
+#include "api_scilab.h"
+#include "MALLOC.h"
 #include "callFunctionFromGateway.h"
 /*--------------------------------------------------------------------------*/
 static gw_generic_table Tab[] =
@@ -33,6 +34,13 @@ static gw_generic_table Tab[] =
 int gw_statistics()
 {  
        Rhs = Max(0, Rhs);
+
+    if(pvApiCtx == NULL)
+       {
+               pvApiCtx = (StrCtx*)MALLOC(sizeof(StrCtx));
+       }
+
+       pvApiCtx->pstName = (char*)Tab[Fin-1].name;
        callFunctionFromGateway(Tab, SIZE_CURRENT_GENERIC_TABLE(Tab));
        return 0;
 }
index d5456bd..048c8c6 100644 (file)
     <Library Include="..\..\..\..\bin\lapack.lib" />
   </ItemGroup>
   <ItemGroup>
+    <ProjectReference Include="..\..\..\..\libs\MALLOC\MALLOC.vcxproj">
+      <Project>{6a84ad8c-ba18-4a3f-9c72-ec3df0939e9e}</Project>
+    </ProjectReference>
     <ProjectReference Include="..\..\..\..\tools\Dumpexts\Dumpexts.vcxproj">
       <Project>{3170e4c2-1173-4264-a222-7ee8ccb3ddf7}</Project>
       <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
     </ProjectReference>
+    <ProjectReference Include="..\..\..\api_scilab\api_scilab.vcxproj">
+      <Project>{43c5bab1-1dca-4743-a183-77e0d42fe7d0}</Project>
+    </ProjectReference>
     <ProjectReference Include="..\..\..\localization\src\localization.vcxproj">
       <Project>{ecffeb0c-1eda-45ee-9a10-b18143852e17}</Project>
       <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
index c7181d7..6a444fb 100644 (file)
@@ -11,7 +11,8 @@
  */
 #include <string.h>
 #include "gw_symbolic.h"
-#include "stack-c.h"
+#include "api_scilab.h"
+#include "MALLOC.h"
 #include "callFunctionFromGateway.h"
 #include "Scierror.h"
 #include "localization.h"
@@ -32,6 +33,13 @@ int gw_symbolic(void)
                Scierror(39,_("%s: Wrong number of input arguments: %d expected.\n"),Tab[Fin-1].name, 2);
                return 0;
        }
+
+    if(pvApiCtx == NULL)
+       {
+               pvApiCtx = (StrCtx*)MALLOC(sizeof(StrCtx));
+       }
+
+       pvApiCtx->pstName = (char*)Tab[Fin-1].name;
        callFunctionFromGateway(Tab, SIZE_CURRENT_GENERIC_TABLE(Tab));
        return 0;
 }
index c7d198f..b130045 100644 (file)
@@ -221,6 +221,9 @@ lib /DEF:"$(ProjectDir)symbolic_f_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Plat
       <Project>{3170e4c2-1173-4264-a222-7ee8ccb3ddf7}</Project>
       <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
     </ProjectReference>
+    <ProjectReference Include="..\..\..\api_scilab\api_scilab.vcxproj">
+      <Project>{43c5bab1-1dca-4743-a183-77e0d42fe7d0}</Project>
+    </ProjectReference>
     <ProjectReference Include="..\..\..\localization\src\localization.vcxproj">
       <Project>{ecffeb0c-1eda-45ee-9a10-b18143852e17}</Project>
       <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
index 5683e19..1201e6c 100644 (file)
@@ -17,7 +17,8 @@
 #include "Scierror.h"
 #include "localization.h"
 #include "gw_tclsci.h"
-#include "stack-c.h"
+#include "api_scilab.h"
+#include "MALLOC.h"
 #include "inisci-c.h"
 #include "scilabmode.h"
 #include "callFunctionFromGateway.h"
@@ -57,6 +58,13 @@ int gw_tclsci(void)
                if (isTkStarted())
                {
                        Rhs = Max(0, Rhs);
+
+            if(pvApiCtx == NULL)
+            {
+                pvApiCtx = (StrCtx*)MALLOC(sizeof(StrCtx));
+            }
+
+            pvApiCtx->pstName = (char*)Tab[Fin-1].name;
                        callFunctionFromGateway(Tab, SIZE_CURRENT_GENERIC_TABLE(Tab));
                }
                else
index ee7e11a..c7b1f68 100644 (file)
@@ -268,6 +268,9 @@ lib /DEF:"$(ProjectDir)scilab_windows_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(
       <Project>{3170e4c2-1173-4264-a222-7ee8ccb3ddf7}</Project>
       <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
     </ProjectReference>
+    <ProjectReference Include="..\api_scilab\api_scilab.vcxproj">
+      <Project>{43c5bab1-1dca-4743-a183-77e0d42fe7d0}</Project>
+    </ProjectReference>
     <ProjectReference Include="..\fileio\fileio.vcxproj">
       <Project>{4fc72d4a-80ee-4b1a-8724-0201c1a35621}</Project>
       <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
index d217b04..78e89aa 100644 (file)
@@ -12,7 +12,8 @@
 
 /*--------------------------------------------------------------------------*/
 #include "gw_time.h"
-#include "stack-c.h"
+#include "api_scilab.h"
+#include "MALLOC.h"
 #include "callFunctionFromGateway.h"
 /*--------------------------------------------------------------------------*/
 static gw_generic_table Tab[]={
@@ -28,6 +29,13 @@ static gw_generic_table Tab[]={
 int gw_time(void)
 {  
        Rhs = Max(0, Rhs);
+
+    if(pvApiCtx == NULL)
+       {
+               pvApiCtx = (StrCtx*)MALLOC(sizeof(StrCtx));
+       }
+
+       pvApiCtx->pstName = (char*)Tab[Fin-1].name;
        callFunctionFromGateway(Tab, SIZE_CURRENT_GENERIC_TABLE(Tab));
        return 0;
 }
index c01128c..d7f0f81 100644 (file)
@@ -12,6 +12,7 @@
 /*--------------------------------------------------------------------------*/
 #include "gw_ui_data.h"
 #include "api_scilab.h"
+#include "MALLOC.h"
 #include "callFunctionFromGateway.h"
 #include "BOOL.h"
 #include "scilabmode.h"
@@ -45,6 +46,13 @@ int gw_ui_data(void)
                loadedDep = TRUE;
        }
 */
+
+    if(pvApiCtx == NULL)
+       {
+               pvApiCtx = (StrCtx*)MALLOC(sizeof(StrCtx));
+       }
+
+       pvApiCtx->pstName = (char*)Tab[Fin-1].name;
        callFunctionFromGateway(Tab, SIZE_CURRENT_GENERIC_TABLE(Tab));
        return 0;
 }
index d65ba8e..8f7cf82 100644 (file)
@@ -43,7 +43,8 @@
 #include "Scierror.h"
 #include "localization.h"
 #include "gw_umfpack.h"
-#include "stack-c.h"
+#include "api_scilab.h"
+#include "MALLOC.h"
 #include "callFunctionFromGateway.h"
 #include "taucs_scilab.h"
 /*--------------------------------------------------------------------------*/
@@ -66,6 +67,12 @@ static gw_generic_table Tab[] =
 /*--------------------------------------------------------------------------*/
 int gw_umfpack(void)
 {
+    if(pvApiCtx == NULL)
+       {
+               pvApiCtx = (StrCtx*)MALLOC(sizeof(StrCtx));
+       }
+
+       pvApiCtx->pstName = (char*)Tab[Fin-1].name;
        callFunctionFromGateway(Tab, SIZE_CURRENT_GENERIC_TABLE(Tab));
        return 0;
 }
index cf20686..306d61d 100644 (file)
@@ -243,6 +243,9 @@ lib /DEF:"$(ProjectDir)Sparse_f_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platfo
       <Project>{3170e4c2-1173-4264-a222-7ee8ccb3ddf7}</Project>
       <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
     </ProjectReference>
+    <ProjectReference Include="..\..\..\api_scilab\api_scilab.vcxproj">
+      <Project>{43c5bab1-1dca-4743-a183-77e0d42fe7d0}</Project>
+    </ProjectReference>
     <ProjectReference Include="..\..\..\localization\src\localization.vcxproj">
       <Project>{ecffeb0c-1eda-45ee-9a10-b18143852e17}</Project>
       <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
index 8430346..10570e2 100644 (file)
@@ -12,7 +12,8 @@
  */
 /*--------------------------------------------------------------------------*/
 #include "gw_xcos.h"
-#include "stack-c.h"
+#include "api_scilab.h"
+#include "MALLOC.h"
 #include "callFunctionFromGateway.h"
 #include "BOOL.h"
 #include "scilabmode.h"
@@ -59,6 +60,14 @@ int gw_xcos(void)
         loadOnUseClassPath("Xcos");
         loadedDep = TRUE;
     }
+
+
+    if(pvApiCtx == NULL)
+       {
+               pvApiCtx = (StrCtx*)MALLOC(sizeof(StrCtx));
+       }
+
+       pvApiCtx->pstName = (char*)Tab[Fin-1].name;
     callFunctionFromGateway(Tab, SIZE_CURRENT_GENERIC_TABLE(Tab));
     return 0;
 }