Xcos: add a fake loadXcos gateway to load Xcos dependencies 76/8276/2
Clément DAVID [Mon, 23 Jul 2012 08:01:21 +0000 (10:01 +0200)]
This call will be used by metanet to avoid any fake xcos call.

Change-Id: Ic0f0cc5678e383cbffedf5b8da00248104bee407

scilab/modules/xcos/Makefile.am
scilab/modules/xcos/Makefile.in
scilab/modules/xcos/includes/gw_xcos.h
scilab/modules/xcos/sci_gateway/c/gw_xcos.c
scilab/modules/xcos/sci_gateway/cpp/sci_loadXcos.cpp [new file with mode: 0644]
scilab/modules/xcos/sci_gateway/xcos_gateway.xml
scilab/modules/xcos/src/c/xcos.vcxproj
scilab/modules/xcos/src/c/xcos.vcxproj.filters

index 38e5447..e24b520 100644 (file)
@@ -67,7 +67,8 @@ GATEWAY_CXX_SOURCES = \
        sci_gateway/cpp/sci_xcosPalGenerateIcon.cpp \
        sci_gateway/cpp/sci_xcosConfigureXmlFile.cpp \
        sci_gateway/cpp/sci_xcosAddToolsMenu.cpp \
-       sci_gateway/cpp/sci_xcosUpdateBlock.cpp
+       sci_gateway/cpp/sci_xcosUpdateBlock.cpp \
+       sci_gateway/cpp/sci_loadXcos.cpp
 
 libscixcos_la_CPPFLAGS = \
                        -I$(srcdir)/includes/ \
index fbbf955..99f6a40 100644 (file)
@@ -150,7 +150,8 @@ am__objects_4 = libscixcos_la-sci_Xcos.lo \
        libscixcos_la-sci_xcosPalGenerateIcon.lo \
        libscixcos_la-sci_xcosConfigureXmlFile.lo \
        libscixcos_la-sci_xcosAddToolsMenu.lo \
-       libscixcos_la-sci_xcosUpdateBlock.lo
+       libscixcos_la-sci_xcosUpdateBlock.lo \
+       libscixcos_la-sci_loadXcos.lo
 am_libscixcos_la_OBJECTS = $(am__objects_3) $(am__objects_4)
 libscixcos_la_OBJECTS = $(am_libscixcos_la_OBJECTS)
 @GUI_TRUE@@XCOS_TRUE@am_libscixcos_la_rpath = -rpath $(pkglibdir)
@@ -490,7 +491,8 @@ GATEWAY_CXX_SOURCES = \
        sci_gateway/cpp/sci_xcosPalGenerateIcon.cpp \
        sci_gateway/cpp/sci_xcosConfigureXmlFile.cpp \
        sci_gateway/cpp/sci_xcosAddToolsMenu.cpp \
-       sci_gateway/cpp/sci_xcosUpdateBlock.cpp
+       sci_gateway/cpp/sci_xcosUpdateBlock.cpp \
+       sci_gateway/cpp/sci_loadXcos.cpp
 
 libscixcos_la_CPPFLAGS = \
                        -I$(srcdir)/includes/ \
@@ -990,6 +992,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscixcos_la-gw_xcos.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscixcos_la-sci_Xcos.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscixcos_la-sci_closeXcosFromScilab.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscixcos_la-sci_loadXcos.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscixcos_la-sci_warnBlockByUID.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscixcos_la-sci_xcosAddToolsMenu.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscixcos_la-sci_xcosConfigureXmlFile.Plo@am__quote@
@@ -1185,6 +1188,13 @@ libscixcos_la-sci_xcosUpdateBlock.lo: sci_gateway/cpp/sci_xcosUpdateBlock.cpp
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCXX_FALSE@ $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscixcos_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libscixcos_la-sci_xcosUpdateBlock.lo `test -f 'sci_gateway/cpp/sci_xcosUpdateBlock.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_xcosUpdateBlock.cpp
 
+libscixcos_la-sci_loadXcos.lo: sci_gateway/cpp/sci_loadXcos.cpp
+@am__fastdepCXX_TRUE@  $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscixcos_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libscixcos_la-sci_loadXcos.lo -MD -MP -MF $(DEPDIR)/libscixcos_la-sci_loadXcos.Tpo -c -o libscixcos_la-sci_loadXcos.lo `test -f 'sci_gateway/cpp/sci_loadXcos.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_loadXcos.cpp
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscixcos_la-sci_loadXcos.Tpo $(DEPDIR)/libscixcos_la-sci_loadXcos.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='sci_gateway/cpp/sci_loadXcos.cpp' object='libscixcos_la-sci_loadXcos.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscixcos_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libscixcos_la-sci_loadXcos.lo `test -f 'sci_gateway/cpp/sci_loadXcos.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_loadXcos.cpp
+
 mostlyclean-libtool:
        -rm -f *.lo
 
index 6ed5ce9..dd89425 100644 (file)
@@ -36,6 +36,7 @@ int sci_xcosPalGenerateIcon(char *fname, unsigned long l);
 int sci_xcosConfigureXmlFile(char *fname, unsigned long l);
 int sci_xcosAddToolsMenu(char *fname, unsigned long l);
 int sci_xcosUpdateBlock(char *fname, unsigned long l);
+int sci_loadXcos(char *fname, unsigned long l);
 
 /*--------------------------------------------------------------------------*/
 /**
index ebe3e1c..c5ac759 100644 (file)
@@ -40,7 +40,8 @@ static gw_generic_table Tab[] =
     {sci_xcosPalGenerateIcon, "xcosPalGenerateIcon"},
     {sci_xcosConfigureXmlFile, "xcosConfigureXmlFile"},
     {sci_xcosAddToolsMenu, "xcosAddToolsMenu"},
-    {sci_xcosUpdateBlock, "xcosUpdateBlock"}
+    {sci_xcosUpdateBlock, "xcosUpdateBlock"},
+    {sci_loadXcos, "loadXcos"}
 };
 
 /*--------------------------------------------------------------------------*/
diff --git a/scilab/modules/xcos/sci_gateway/cpp/sci_loadXcos.cpp b/scilab/modules/xcos/sci_gateway/cpp/sci_loadXcos.cpp
new file mode 100644 (file)
index 0000000..c85580d
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+* Copyright (C) 2012 - Scilal Enterprises - Clément DAVID
+*
+* 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-en.txt
+*
+*/
+extern "C"
+{
+#include "gw_xcos.h"
+#include "api_scilab.h"
+}
+
+/*
+ * Stub function to load the gateway
+ */
+int sci_loadXcos(char *fname, unsigned long fname_len)
+{
+    CheckRhs(0, 1);
+    LhsVar(1) = 0;
+    PutLhsVar();
+    return 0;
+}
+
index ecca9be..c3bc6a5 100644 (file)
@@ -35,4 +35,5 @@
   <PRIMITIVE gatewayId="64" primitiveId="12" primitiveName="xcosConfigureXmlFile"/>
   <PRIMITIVE gatewayId="64" primitiveId="13" primitiveName="xcosAddToolsMenu"/>
   <PRIMITIVE gatewayId="64" primitiveId="14" primitiveName="xcosUpdateBlock"/>
+  <PRIMITIVE gatewayId="64" primitiveId="15" primitiveName="loadXcos"/>
 </GATEWAY>
index 0956559..027d6f3 100644 (file)
     <ClCompile Include="..\..\sci_gateway\cpp\sci_xcosPalMove.cpp" />
     <ClCompile Include="..\..\sci_gateway\cpp\sci_xcosAddToolsMenu.cpp" />
     <ClCompile Include="..\..\sci_gateway\cpp\sci_xcosUpdateBlock.cpp" />
+    <ClCompile Include="..\..\sci_gateway\cpp\sci_loadXcos.cpp" />
     <ClCompile Include="..\jni\Xcos.cpp" />
     <ClCompile Include="..\cpp\xcosUtilities.cpp" />
   </ItemGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
   </ImportGroup>
-</Project>
\ No newline at end of file
+</Project>
index 02807b3..06a2ab3 100644 (file)
@@ -83,6 +83,9 @@
     <ClCompile Include="..\..\sci_gateway\cpp\sci_xcosUpdateBlock.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\sci_gateway\cpp\sci_loadXcos.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\..\includes\dynlib_xcos.h">
       <Filter>Resource Files</Filter>
     </ResourceCompile>
   </ItemGroup>
-</Project>
\ No newline at end of file
+</Project>