add isfile and with_module functions 30/2030/2
antoine ELIAS [Wed, 22 Sep 2010 08:33:28 +0000 (10:33 +0200)]
Change-Id: I2ef8ef0d4e3eb582b792a2195a6551b71f44850e

20 files changed:
scilab/modules/core/Makefile.am
scilab/modules/core/Makefile.in
scilab/modules/core/includes/core_gw.hxx
scilab/modules/core/includes/gw_core.h
scilab/modules/core/sci_gateway/c/gw_core.c
scilab/modules/core/sci_gateway/c/sci_with_module.c [deleted file]
scilab/modules/core/sci_gateway/cpp/sci_with_module.cpp [new file with mode: 0644]
scilab/modules/core/src/c/core.vcproj
scilab/modules/core/src/cpp/core_gw.cpp
scilab/modules/core/src/cpp/core_gw.vcproj
scilab/modules/data_structures/macros/struct.sci [deleted file]
scilab/modules/fileio/Makefile.am
scilab/modules/fileio/Makefile.in
scilab/modules/fileio/fileio.vcproj
scilab/modules/fileio/includes/fileio_gw.hxx
scilab/modules/fileio/includes/gw_fileio.h
scilab/modules/fileio/sci_gateway/c/sci_isfile.c [deleted file]
scilab/modules/fileio/sci_gateway/cpp/fileio_gw.cpp
scilab/modules/fileio/sci_gateway/cpp/fileio_gw.vcproj
scilab/modules/fileio/sci_gateway/cpp/sci_isfile.cpp [new file with mode: 0644]

index 2d2a548..fb57b78 100644 (file)
@@ -233,7 +233,6 @@ sci_gateway/c/gw_core.c \
 sci_gateway/c/gw_user.c \
 sci_gateway/c/gw_user2.c \
 sci_gateway/c/sci_error.c \
-sci_gateway/c/sci_with_module.c \
 sci_gateway/c/sci_islittleendian.c \
 sci_gateway/c/sci_getvariablesonstack.c \
 sci_gateway/c/sci_readgateway.c \
@@ -267,7 +266,8 @@ GATEWAY_CPP_SOURCES =       \
        sci_gateway/cpp/sci_isglobal.cpp \
        sci_gateway/cpp/sci_getscilabmode.cpp \
        sci_gateway/cpp/sci_getos.cpp \
-       sci_gateway/cpp/sci_exists.cpp
+       sci_gateway/cpp/sci_exists.cpp \
+       sci_gateway/cpp/sci_with_module.cpp
 
 libscicore_la_CFLAGS = -I$(srcdir)/includes/ \
        -I$(srcdir)/src/c/ \
index c10af78..96b3467 100644 (file)
@@ -213,7 +213,6 @@ am__libscicore_la_SOURCES_DIST = src/c/inffic.c src/c/cs2st.c \
        sci_gateway/c/sci_getdebuginfo.c sci_gateway/c/sci_debug.c \
        sci_gateway/c/gw_core.c sci_gateway/c/gw_user.c \
        sci_gateway/c/gw_user2.c sci_gateway/c/sci_error.c \
-       sci_gateway/c/sci_with_module.c \
        sci_gateway/c/sci_islittleendian.c \
        sci_gateway/c/sci_getvariablesonstack.c \
        sci_gateway/c/sci_readgateway.c sci_gateway/c/sci_comp.c \
@@ -238,7 +237,8 @@ am__libscicore_la_SOURCES_DIST = src/c/inffic.c src/c/cs2st.c \
        sci_gateway/cpp/sci_global.cpp \
        sci_gateway/cpp/sci_isglobal.cpp \
        sci_gateway/cpp/sci_getscilabmode.cpp \
-       sci_gateway/cpp/sci_getos.cpp sci_gateway/cpp/sci_exists.cpp
+       sci_gateway/cpp/sci_getos.cpp sci_gateway/cpp/sci_exists.cpp \
+       sci_gateway/cpp/sci_with_module.cpp
 @USE_DYNAMIC_STACK_TRUE@am__objects_1 = libscicore_la-scimem64.lo
 am__objects_2 = libscicore_la-inffic.lo libscicore_la-cs2st.lo \
        libscicore_la-intmacr2tree.lo libscicore_la-run.lo \
@@ -327,7 +327,6 @@ am__objects_6 = libscicore_la-sci_stacksize.lo \
        libscicore_la-sci_getdebuginfo.lo libscicore_la-sci_debug.lo \
        libscicore_la-gw_core.lo libscicore_la-gw_user.lo \
        libscicore_la-gw_user2.lo libscicore_la-sci_error.lo \
-       libscicore_la-sci_with_module.lo \
        libscicore_la-sci_islittleendian.lo \
        libscicore_la-sci_getvariablesonstack.lo \
        libscicore_la-sci_readgateway.lo libscicore_la-sci_comp.lo
@@ -341,7 +340,7 @@ am__objects_8 = libscicore_la-sci_getmodules.lo \
        libscicore_la-sci_argn.lo libscicore_la-sci_clearglobal.lo \
        libscicore_la-sci_global.lo libscicore_la-sci_isglobal.lo \
        libscicore_la-sci_getscilabmode.lo libscicore_la-sci_getos.lo \
-       libscicore_la-sci_exists.lo
+       libscicore_la-sci_exists.lo libscicore_la-sci_with_module.lo
 am_libscicore_la_OBJECTS = $(am__objects_2) $(am__objects_4) \
        $(am__objects_5) $(am__objects_6) $(am__objects_7) \
        $(am__objects_8)
@@ -749,7 +748,6 @@ sci_gateway/c/gw_core.c \
 sci_gateway/c/gw_user.c \
 sci_gateway/c/gw_user2.c \
 sci_gateway/c/sci_error.c \
-sci_gateway/c/sci_with_module.c \
 sci_gateway/c/sci_islittleendian.c \
 sci_gateway/c/sci_getvariablesonstack.c \
 sci_gateway/c/sci_readgateway.c \
@@ -783,7 +781,8 @@ GATEWAY_CPP_SOURCES = \
        sci_gateway/cpp/sci_isglobal.cpp \
        sci_gateway/cpp/sci_getscilabmode.cpp \
        sci_gateway/cpp/sci_getos.cpp \
-       sci_gateway/cpp/sci_exists.cpp
+       sci_gateway/cpp/sci_exists.cpp \
+       sci_gateway/cpp/sci_with_module.cpp
 
 libscicore_la_CFLAGS = -I$(srcdir)/includes/ -I$(srcdir)/src/c/ \
        -I$(top_srcdir)/libs/MALLOC/includes/ \
@@ -1954,13 +1953,6 @@ libscicore_la-sci_error.lo: sci_gateway/c/sci_error.c
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicore_la_CPPFLAGS) $(CPPFLAGS) $(libscicore_la_CFLAGS) $(CFLAGS) -c -o libscicore_la-sci_error.lo `test -f 'sci_gateway/c/sci_error.c' || echo '$(srcdir)/'`sci_gateway/c/sci_error.c
 
-libscicore_la-sci_with_module.lo: sci_gateway/c/sci_with_module.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicore_la_CPPFLAGS) $(CPPFLAGS) $(libscicore_la_CFLAGS) $(CFLAGS) -MT libscicore_la-sci_with_module.lo -MD -MP -MF $(DEPDIR)/libscicore_la-sci_with_module.Tpo -c -o libscicore_la-sci_with_module.lo `test -f 'sci_gateway/c/sci_with_module.c' || echo '$(srcdir)/'`sci_gateway/c/sci_with_module.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscicore_la-sci_with_module.Tpo $(DEPDIR)/libscicore_la-sci_with_module.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/sci_with_module.c' object='libscicore_la-sci_with_module.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicore_la_CPPFLAGS) $(CPPFLAGS) $(libscicore_la_CFLAGS) $(CFLAGS) -c -o libscicore_la-sci_with_module.lo `test -f 'sci_gateway/c/sci_with_module.c' || echo '$(srcdir)/'`sci_gateway/c/sci_with_module.c
-
 libscicore_la-sci_islittleendian.lo: sci_gateway/c/sci_islittleendian.c
 @am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicore_la_CPPFLAGS) $(CPPFLAGS) $(libscicore_la_CFLAGS) $(CFLAGS) -MT libscicore_la-sci_islittleendian.lo -MD -MP -MF $(DEPDIR)/libscicore_la-sci_islittleendian.Tpo -c -o libscicore_la-sci_islittleendian.lo `test -f 'sci_gateway/c/sci_islittleendian.c' || echo '$(srcdir)/'`sci_gateway/c/sci_islittleendian.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscicore_la-sci_islittleendian.Tpo $(DEPDIR)/libscicore_la-sci_islittleendian.Plo
@@ -2143,6 +2135,13 @@ libscicore_la-sci_exists.lo: sci_gateway/cpp/sci_exists.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) $(libscicore_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libscicore_la-sci_exists.lo `test -f 'sci_gateway/cpp/sci_exists.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_exists.cpp
 
+libscicore_la-sci_with_module.lo: sci_gateway/cpp/sci_with_module.cpp
+@am__fastdepCXX_TRUE@  $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicore_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libscicore_la-sci_with_module.lo -MD -MP -MF $(DEPDIR)/libscicore_la-sci_with_module.Tpo -c -o libscicore_la-sci_with_module.lo `test -f 'sci_gateway/cpp/sci_with_module.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_with_module.cpp
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscicore_la-sci_with_module.Tpo $(DEPDIR)/libscicore_la-sci_with_module.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='sci_gateway/cpp/sci_with_module.cpp' object='libscicore_la-sci_with_module.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) $(libscicore_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libscicore_la-sci_with_module.lo `test -f 'sci_gateway/cpp/sci_with_module.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_with_module.cpp
+
 .f.o:
        $(F77COMPILE) -c -o $@ $<
 
index bc56241..9a7fb10 100644 (file)
@@ -40,5 +40,6 @@ CPP_GATEWAY_PROTOTYPE(sci_clearglobal);
 CPP_GATEWAY_PROTOTYPE(sci_isglobal);
 CPP_GATEWAY_PROTOTYPE(sci_getscilabmode);
 CPP_GATEWAY_PROTOTYPE(sci_getos);
+CPP_GATEWAY_PROTOTYPE(sci_with_module);
 
 #endif /* __CORE_GW_HXX__ */
index bfc1b39..9f2232a 100644 (file)
@@ -53,7 +53,6 @@ int C2F(sci_fromjava)(char *fname,unsigned long fname_len);
 int C2F(sci_getmemory)(char *fname,unsigned long fname_len);
 int C2F(sci_fromc)(char *fname,unsigned long fname_len);
 int C2F(sci_getmd5)(char *fname,unsigned long fname_len);
-int C2F(sci_with_module)(char *fname,unsigned long fname_len);
 int C2F(sci_islittleendian)(char *fname,unsigned long fname_len);
 int C2F(sci_librarieslist)(char *fname,unsigned long fname_len);
 int C2F(sci_libraryinfo)(char *fname,unsigned long fname_len);
index 267c8c0..62342b0 100644 (file)
@@ -67,7 +67,7 @@ static gw_generic_table Tab[]=
 {C2F(sci_getmemory),"getmemory"},
 {C2F(sci_getmd5),"getmd5"},
 {NULL,""}, //getmodules
-{C2F(sci_with_module),"with_module"},
+{NULL, ""}, //with_module
 {NULL, ""}, //getdebuginfo
 {C2F(sci_readgateway),"readgateway"},
 {NULL, ""} //exit
diff --git a/scilab/modules/core/sci_gateway/c/sci_with_module.c b/scilab/modules/core/sci_gateway/c/sci_with_module.c
deleted file mode 100644 (file)
index e1a0da8..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) 2006 - INRIA - Allan CORNET
- * 
- * 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
- *
- */
-#include "gw_core.h"
-#include "stack-c.h"
-#include "with_module.h"
-#include "MALLOC.h"
-#include "Scierror.h"
-#include "localization.h"
-/*--------------------------------------------------------------------------*/
-int C2F(sci_with_module)(char *fname,unsigned long fname_len)
-{
-       static int l1,n1,m1;
-       int *Status=NULL;
-
-       CheckRhs(1,1);
-       CheckLhs(1,1);
-
-       if (GetType(1) == sci_strings)
-       {
-               char *VarName=NULL;
-
-               GetRhsVar(1,STRING_DATATYPE,&m1,&n1,&l1);
-               VarName=cstk(l1);
-
-               Status=(int*)MALLOC(sizeof(int));
-               *Status=with_module(VarName);
-
-               m1=1;n1=1;
-               CreateVarFromPtr(Rhs+1,MATRIX_OF_BOOLEAN_DATATYPE, &n1, &n1, &Status);
-               LhsVar(1)=Rhs+1;
-
-               C2F(putlhsvar)();
-
-               if (Status) {FREE(Status);Status=NULL;}
-       }
-       else
-       {
-               Scierror(999,_("%s: Wrong type for input argument #%d: String expected.\n"), fname,1);
-               return 0;
-       }
-
-       return 0;
-}
-/*--------------------------------------------------------------------------*/
-
-
diff --git a/scilab/modules/core/sci_gateway/cpp/sci_with_module.cpp b/scilab/modules/core/sci_gateway/cpp/sci_with_module.cpp
new file mode 100644 (file)
index 0000000..2da5864
--- /dev/null
@@ -0,0 +1,90 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2006 - INRIA - Allan CORNET
+ * 
+ * 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
+ *
+ */
+
+#include "core_gw.hxx"
+#include "funcmanager.hxx"
+#include "alltypes.hxx"
+#include "configvariable.hxx"
+
+
+extern "C"
+{
+#include "charEncoding.h"
+#include "Scierror.h"
+#include "localization.h"
+}
+/*--------------------------------------------------------------------------*/
+types::Function::ReturnValue sci_with_module(types::typed_list &in, int _iRetCount, types::typed_list &out)
+{
+    if(in.size() != 1)
+    {
+        ScierrorW(77, _W("%ls: Wrong number of input argument(s): %d expected.\n"), L"with_module", 1);
+        return types::Function::Error;
+    }
+
+    if(in[0]->isString() == false || in[0]->getAsString()->size_get() != 1)
+    {
+               ScierrorW(999, _W("%ls: Wrong type for input argument #%d: String expected.\n"), L"with_module", 1);
+        return types::Function::Error;
+    }
+
+    wchar_t* pwstModuleName = in[0]->getAsString()->string_get(0);
+
+    types::Bool* pOut = new types::Bool(0);
+    list<wstring> sModuleList = ConfigVariable::getModuleList();
+    list<wstring>::iterator it;
+    for(it = sModuleList.begin() ; it != sModuleList.end() ; it++)
+    {
+        if(*it == pwstModuleName)
+        {
+            pOut->bool_get()[0] = 1;
+            break;
+        }
+    }
+
+    out.push_back(pOut);
+    return types::Function::OK;
+       //static int l1,n1,m1;
+       //int *Status=NULL;
+
+       //CheckRhs(1,1);
+       //CheckLhs(1,1);
+
+       //if (GetType(1) == sci_strings)
+       //{
+       //      char *VarName=NULL;
+
+       //      GetRhsVar(1,STRING_DATATYPE,&m1,&n1,&l1);
+       //      VarName=cstk(l1);
+
+       //      Status=(int*)MALLOC(sizeof(int));
+       //      *Status=with_module(VarName);
+
+       //      m1=1;n1=1;
+       //      CreateVarFromPtr(Rhs+1,MATRIX_OF_BOOLEAN_DATATYPE, &n1, &n1, &Status);
+       //      LhsVar(1)=Rhs+1;
+
+       //      C2F(putlhsvar)();
+
+       //      if (Status) {FREE(Status);Status=NULL;}
+       //}
+       //else
+       //{
+       //      Scierror(999,_("%s: Wrong type for input argument #%d: String expected.\n"), fname,1);
+       //      return 0;
+       //}
+
+       //return 0;
+}
+/*--------------------------------------------------------------------------*/
+
+
index 5a92970..0cf8370 100644 (file)
                                >
                        </File>
                        <File
-                               RelativePath="..\..\sci_gateway\c\sci_with_module.c"
-                               >
-                       </File>
-                       <File
                                RelativePath=".\scimem.c"
                                >
                        </File>
index e516c10..060f9a8 100644 (file)
@@ -39,6 +39,7 @@ bool CoreModule::Load()
     symbol::Context::getInstance()->AddFunction(Function::createFunction(L"isglobal", &sci_isglobal, MODULE_NAME));
     symbol::Context::getInstance()->AddFunction(Function::createFunction(L"getos", &sci_getos, MODULE_NAME));
     symbol::Context::getInstance()->AddFunction(Function::createFunction(L"getscilabmode", &sci_getscilabmode, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(Function::createFunction(L"with_module", &sci_with_module, MODULE_NAME));
     return true;
 }
 
index 7c92a29..5fdb959 100644 (file)
@@ -44,7 +44,7 @@
                        <Tool
                                Name="VCCLCompilerTool"
                                Optimization="0"
-                               AdditionalIncludeDirectories="../../includes;../../../functions_manager/includes;../../../types/includes;../../../symbol/includes;../../../abstractSyntaxTree/includes;../../../elementary_functions/includes;../../../operations/includes;../../../api_scilab/includes;../../../output_stream/includes;../../../localization/includes;../../../../libs/intl;../../../system_env/includes;../../../../libs/MALLOC/includes;../../../string/includes"
+                               AdditionalIncludeDirectories="../../includes;../../src/c;../../../functions_manager/includes;../../../types/includes;../../../symbol/includes;../../../abstractSyntaxTree/includes;../../../elementary_functions/includes;../../../operations/includes;../../../api_scilab/includes;../../../output_stream/includes;../../../localization/includes;../../../../libs/intl;../../../system_env/includes;../../../../libs/MALLOC/includes;../../../string/includes"
                                PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;CORE_GW_EXPORTS"
                                MinimalRebuild="true"
                                BasicRuntimeChecks="3"
                        <Tool
                                Name="VCCLCompilerTool"
                                Optimization="0"
-                               AdditionalIncludeDirectories="../../includes;../../../functions_manager/includes;../../../types/includes;../../../symbol/includes;../../../abstractSyntaxTree/includes;../../../elementary_functions/includes;../../../operations/includes;../../../api_scilab/includes;../../../output_stream/includes;../../../localization/includes;../../../../libs/intl;../../../system_env/includes;../../../../libs/MALLOC/includes;../../../string/includes"
+                               AdditionalIncludeDirectories="../../includes;../../src/c;../../../functions_manager/includes;../../../types/includes;../../../symbol/includes;../../../abstractSyntaxTree/includes;../../../elementary_functions/includes;../../../operations/includes;../../../api_scilab/includes;../../../output_stream/includes;../../../localization/includes;../../../../libs/intl;../../../system_env/includes;../../../../libs/MALLOC/includes;../../../string/includes"
                                PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;CORE_GW_EXPORTS"
                                MinimalRebuild="true"
                                BasicRuntimeChecks="3"
                                Name="VCCLCompilerTool"
                                Optimization="2"
                                EnableIntrinsicFunctions="true"
-                               AdditionalIncludeDirectories="../../includes;../../../functions_manager/includes;../../../types/includes;../../../symbol/includes;../../../abstractSyntaxTree/includes;../../../elementary_functions/includes;../../../operations/includes;../../../api_scilab/includes;../../../output_stream/includes;../../../localization/includes;../../../../libs/intl;../../../system_env/includes;../../../../libs/MALLOC/includes;../../../string/includes"
+                               AdditionalIncludeDirectories="../../includes;../../src/c;../../../functions_manager/includes;../../../types/includes;../../../symbol/includes;../../../abstractSyntaxTree/includes;../../../elementary_functions/includes;../../../operations/includes;../../../api_scilab/includes;../../../output_stream/includes;../../../localization/includes;../../../../libs/intl;../../../system_env/includes;../../../../libs/MALLOC/includes;../../../string/includes"
                                PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;CORE_GW_EXPORTS"
                                RuntimeLibrary="2"
                                EnableFunctionLevelLinking="true"
                                Name="VCCLCompilerTool"
                                Optimization="2"
                                EnableIntrinsicFunctions="true"
-                               AdditionalIncludeDirectories="../../includes;../../../functions_manager/includes;../../../types/includes;../../../symbol/includes;../../../abstractSyntaxTree/includes;../../../elementary_functions/includes;../../../operations/includes;../../../api_scilab/includes;../../../output_stream/includes;../../../localization/includes;../../../../libs/intl;../../../system_env/includes;../../../../libs/MALLOC/includes;../../../string/includes"
+                               AdditionalIncludeDirectories="../../includes;../../src/c;../../../functions_manager/includes;../../../types/includes;../../../symbol/includes;../../../abstractSyntaxTree/includes;../../../elementary_functions/includes;../../../operations/includes;../../../api_scilab/includes;../../../output_stream/includes;../../../localization/includes;../../../../libs/intl;../../../system_env/includes;../../../../libs/MALLOC/includes;../../../string/includes"
                                PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;CORE_GW_EXPORTS"
                                RuntimeLibrary="2"
                                EnableFunctionLevelLinking="true"
                                RelativePath="..\..\sci_gateway\cpp\sci_quit.cpp"
                                >
                        </File>
+                       <File
+                               RelativePath="..\..\sci_gateway\cpp\sci_with_module.cpp"
+                               >
+                       </File>
                </Filter>
                <Filter
                        Name="Header Files"
diff --git a/scilab/modules/data_structures/macros/struct.sci b/scilab/modules/data_structures/macros/struct.sci
deleted file mode 100644 (file)
index b147071..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) ????-2008 - INRIA - Vincent COUVERT
-//
-// 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
-
-
-function s=struct(varargin)
-// Equivalent for Matlab struct function
-
-rhs=argn(2)
-
-fields=["st","dims"];
-
-if rhs==0 then
-  // No Matlab equivalent
-  s=mlist(fields,int32([0,0]))
-  return
-end
-
-if floor(rhs/2)*2<>rhs then
-  error(msprintf(gettext("%s: Wrong number of input argument(s) : an even number is expected.\n"),"struct"));
-end
-
-nbfields=size(varargin)/2
-
-dims=[]
-for kf=1:2:size(varargin)
-  if varargin(kf)=="dims" then
-    error(msprintf(gettext("%s: ''dims'' can not be used as a field name.\n"),"struct"));
-  end
-  if or(varargin(kf)==fields(2:$)) then
-    error(msprintf(gettext("%s: field name ''%s'' defined twice.\n"),"struct",varargin(kf)));
-  end
-  fields=[fields varargin(kf)]
-end
-
-dims=[1 1]
-// Search struct size
-for kf=2:2:size(varargin)
-  if typeof(varargin(kf))=="ce" then
-    if or(double(varargin(kf).dims)<>[1 1]) then
-      dims=varargin(kf).dims
-      break
-    end
-  end
-end
-s=mlist(fields,int32(dims))
-
-// Search if one value is a scalar cell
-fnb=3
-for kf=2:2:size(varargin)
-  if typeof(varargin(kf))<>"ce" then
-    value=list()
-    for kk=1:prod(double(dims))
-      value(kk)=varargin(kf)
-    end
-  elseif and(double(varargin(kf).dims)==[1 1]) then
-    value=list()
-    for kk=1:prod(double(dims))
-      value(kk)=varargin(kf).entries
-    end
-  else
-    value=varargin(kf).entries
-  end
-  if prod(double(dims))==1 then
-  setfield(fnb,value(1),s)
-  else
-    setfield(fnb,value,s)
-  end
-  fnb=fnb+1
-end
-
-endfunction
index b1062c7..abda1a6 100644 (file)
@@ -46,7 +46,7 @@ src/c/basename.c \
 src/c/pathconvert.c \
 src/c/copyfile_others.c \
 src/c/getFullFilename.c \
-src/c/os_wfopen.c 
+src/c/os_wfopen.c
 
 GATEWAY_C_SOURCES = \
 sci_gateway/c/gw_fileio.c \
@@ -80,8 +80,7 @@ sci_gateway/c/sci_newest.c \
 sci_gateway/c/sci_get_absolute_file_path.c  \
 sci_gateway/c/sci_getrelativefilename.c \
 sci_gateway/c/sci_copyfile.c \
-sci_gateway/c/sci_movefile.c \
-sci_gateway/c/sci_isfile.c
+sci_gateway/c/sci_movefile.c
 
 GATEWAY_CPP_SOURCES = \
        sci_gateway/cpp/fileio_gw.cpp \
@@ -96,7 +95,9 @@ GATEWAY_CPP_SOURCES = \
        sci_gateway/cpp/sci_filesep.cpp \
        sci_gateway/cpp/sci_fileparts.cpp \
        sci_gateway/cpp/sci_findfiles.cpp \
-       sci_gateway/cpp/sci_basename.cpp
+       sci_gateway/cpp/sci_basename.cpp \
+       sci_gateway/cpp/sci_isfile.cpp
+
 
 FILEIO_CPP_SOURCES = \
        src/cpp/expandPathVariable.cpp \
index 79ad78c..0c29b54 100644 (file)
@@ -172,7 +172,7 @@ am__objects_3 = libscifileio_la-gw_fileio.lo \
        libscifileio_la-sci_get_absolute_file_path.lo \
        libscifileio_la-sci_getrelativefilename.lo \
        libscifileio_la-sci_copyfile.lo \
-       libscifileio_la-sci_movefile.lo libscifileio_la-sci_isfile.lo
+       libscifileio_la-sci_movefile.lo
 am__objects_4 = libscifileio_la-fileio_gw.lo \
        libscifileio_la-sci_mopen.lo libscifileio_la-sci_mclose.lo \
        libscifileio_la-sci_mget.lo libscifileio_la-sci_mput.lo \
@@ -181,7 +181,7 @@ am__objects_4 = libscifileio_la-fileio_gw.lo \
        libscifileio_la-sci_isdir.lo libscifileio_la-sci_filesep.lo \
        libscifileio_la-sci_fileparts.lo \
        libscifileio_la-sci_findfiles.lo \
-       libscifileio_la-sci_basename.lo
+       libscifileio_la-sci_basename.lo libscifileio_la-sci_isfile.lo
 am_libscifileio_la_OBJECTS = $(am__objects_1) $(am__objects_2) \
        $(am__objects_3) $(am__objects_4)
 libscifileio_la_OBJECTS = $(am_libscifileio_la_OBJECTS)
@@ -509,7 +509,7 @@ src/c/basename.c \
 src/c/pathconvert.c \
 src/c/copyfile_others.c \
 src/c/getFullFilename.c \
-src/c/os_wfopen.c 
+src/c/os_wfopen.c
 
 GATEWAY_C_SOURCES = \
 sci_gateway/c/gw_fileio.c \
@@ -543,8 +543,7 @@ sci_gateway/c/sci_newest.c \
 sci_gateway/c/sci_get_absolute_file_path.c  \
 sci_gateway/c/sci_getrelativefilename.c \
 sci_gateway/c/sci_copyfile.c \
-sci_gateway/c/sci_movefile.c \
-sci_gateway/c/sci_isfile.c
+sci_gateway/c/sci_movefile.c
 
 GATEWAY_CPP_SOURCES = \
        sci_gateway/cpp/fileio_gw.cpp \
@@ -559,7 +558,8 @@ GATEWAY_CPP_SOURCES = \
        sci_gateway/cpp/sci_filesep.cpp \
        sci_gateway/cpp/sci_fileparts.cpp \
        sci_gateway/cpp/sci_findfiles.cpp \
-       sci_gateway/cpp/sci_basename.cpp
+       sci_gateway/cpp/sci_basename.cpp \
+       sci_gateway/cpp/sci_isfile.cpp
 
 FILEIO_CPP_SOURCES = \
        src/cpp/expandPathVariable.cpp \
@@ -1410,13 +1410,6 @@ libscifileio_la-sci_movefile.lo: sci_gateway/c/sci_movefile.c
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscifileio_la_CPPFLAGS) $(CPPFLAGS) $(libscifileio_la_CFLAGS) $(CFLAGS) -c -o libscifileio_la-sci_movefile.lo `test -f 'sci_gateway/c/sci_movefile.c' || echo '$(srcdir)/'`sci_gateway/c/sci_movefile.c
 
-libscifileio_la-sci_isfile.lo: sci_gateway/c/sci_isfile.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscifileio_la_CPPFLAGS) $(CPPFLAGS) $(libscifileio_la_CFLAGS) $(CFLAGS) -MT libscifileio_la-sci_isfile.lo -MD -MP -MF $(DEPDIR)/libscifileio_la-sci_isfile.Tpo -c -o libscifileio_la-sci_isfile.lo `test -f 'sci_gateway/c/sci_isfile.c' || echo '$(srcdir)/'`sci_gateway/c/sci_isfile.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscifileio_la-sci_isfile.Tpo $(DEPDIR)/libscifileio_la-sci_isfile.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/sci_isfile.c' object='libscifileio_la-sci_isfile.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscifileio_la_CPPFLAGS) $(CPPFLAGS) $(libscifileio_la_CFLAGS) $(CFLAGS) -c -o libscifileio_la-sci_isfile.lo `test -f 'sci_gateway/c/sci_isfile.c' || echo '$(srcdir)/'`sci_gateway/c/sci_isfile.c
-
 .cpp.o:
 @am__fastdepCXX_TRUE@  $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
 @am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@@ -1585,6 +1578,13 @@ libscifileio_la-sci_basename.lo: sci_gateway/cpp/sci_basename.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) $(libscifileio_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libscifileio_la-sci_basename.lo `test -f 'sci_gateway/cpp/sci_basename.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_basename.cpp
 
+libscifileio_la-sci_isfile.lo: sci_gateway/cpp/sci_isfile.cpp
+@am__fastdepCXX_TRUE@  $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscifileio_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libscifileio_la-sci_isfile.lo -MD -MP -MF $(DEPDIR)/libscifileio_la-sci_isfile.Tpo -c -o libscifileio_la-sci_isfile.lo `test -f 'sci_gateway/cpp/sci_isfile.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_isfile.cpp
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscifileio_la-sci_isfile.Tpo $(DEPDIR)/libscifileio_la-sci_isfile.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='sci_gateway/cpp/sci_isfile.cpp' object='libscifileio_la-sci_isfile.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) $(libscifileio_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libscifileio_la-sci_isfile.lo `test -f 'sci_gateway/cpp/sci_isfile.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_isfile.cpp
+
 mostlyclean-libtool:
        -rm -f *.lo
 
index e17cbf5..888e305 100644 (file)
                                >
                        </File>
                        <File
-                               RelativePath=".\sci_gateway\c\sci_isfile.c"
-                               >
-                       </File>
-                       <File
                                RelativePath=".\sci_gateway\c\sci_maxfiles.c"
                                >
                        </File>
index cae4ec7..1a4ff1a 100644 (file)
@@ -48,5 +48,6 @@ CPP_GATEWAY_PROTOTYPE(sci_filesep);
 CPP_GATEWAY_PROTOTYPE(sci_fileparts);
 CPP_GATEWAY_PROTOTYPE(sci_findfiles);
 CPP_GATEWAY_PROTOTYPE(sci_basename);
+CPP_GATEWAY_PROTOTYPE(sci_isfile);
 
 #endif /* !__FILEIO_GW_HXX__ */
index ab77795..4aac7f0 100644 (file)
@@ -50,7 +50,6 @@ FILEIO_IMPEXP int sci_pwd(char *fname, int* _piKey);
 FILEIO_IMPEXP int sci_chdir(char *fname, int* _piKey);
 FILEIO_IMPEXP int sci_copyfile(char *fname,int* _piKey);
 FILEIO_IMPEXP int sci_movefile(char *fname, int* _piKey);
-FILEIO_IMPEXP int sci_isfile(char *fname, int* _piKey);
 
 /*--------------------------------------------------------------------------*/ 
 #endif /* __GW_FILEIO_H__ */
diff --git a/scilab/modules/fileio/sci_gateway/c/sci_isfile.c b/scilab/modules/fileio/sci_gateway/c/sci_isfile.c
deleted file mode 100644 (file)
index 0d76792..0000000
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
-* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-* Copyright (C) 2009 - DIGITEO - Allan CORNET
-*
-* 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
-*
-*/
-/*--------------------------------------------------------------------------*/
-#include "gw_fileio.h"
-#include "stack-c.h"
-#include "MALLOC.h"
-#include "localization.h"
-#include "api_scilab.h"
-#include "Scierror.h"
-#include "FileExist.h"
-#include "isdir.h"
-#include "expandPathVariable.h"
-#include "freeArrayOfString.h"
-#include "BOOL.h"
-/*--------------------------------------------------------------------------*/
-int sci_isfile(char *fname, int *_piKey)
-{
-       SciErr sciErr;
-       int *piAddressVarOne = NULL;
-       wchar_t **pStVarOne = NULL;
-       int iType = 0;
-       int *lenStVarOne = NULL;
-       int m1 = 0, n1 = 0;
-
-       BOOL *results = NULL;
-       int m_out = 0, n_out = 0;
-       int i = 0;
-
-       /* Check Input & Output parameters */
-       CheckRhs(1,1);
-       CheckLhs(1,1);
-
-       sciErr = getVarAddressFromPosition(_piKey, 1, &piAddressVarOne);
-       if(sciErr.iErr)
-       {
-               printError(&sciErr, 0);
-               return 0;
-       }
-
-       sciErr = getVarType(_piKey, piAddressVarOne, &iType);
-       if(sciErr.iErr)
-       {
-               printError(&sciErr, 0);
-               return 0;
-       }
-
-       if (iType != sci_strings)
-       {
-               Scierror(999,_("%s: Wrong type for input argument #%d: A string expected.\n"), fname, 1);
-               return 0;
-       }
-
-       sciErr = getVarDimension(_piKey, piAddressVarOne, &m1, &n1);
-       if(sciErr.iErr)
-       {
-               printError(&sciErr, 0);
-               return 0;
-       }
-
-
-       lenStVarOne = (int*)MALLOC(sizeof(int) * (m1 * n1));
-       if (lenStVarOne == NULL)
-       {
-               Scierror(999,_("%s: Memory allocation error.\n"),fname);
-               return 0;
-       }
-
-       results = (BOOL*)MALLOC(sizeof(BOOL) * (m1 * n1));
-       if (results == NULL)
-       {
-               if (lenStVarOne) {FREE(lenStVarOne); lenStVarOne = NULL;}
-               freeArrayOfWideString(pStVarOne, m1 * n1);
-               Scierror(999,_("%s: Memory allocation error.\n"),fname);
-               return 0;
-       }
-
-       sciErr = getMatrixOfWideString(_piKey, piAddressVarOne, &m1, &n1, lenStVarOne, pStVarOne);
-       if(sciErr.iErr)
-       {
-               printError(&sciErr, 0);
-               return 0;
-       }
-
-       pStVarOne = (wchar_t**)MALLOC(sizeof(wchar_t*) * (m1 * n1));
-       if (pStVarOne == NULL)
-       {
-               if (lenStVarOne) {FREE(lenStVarOne); lenStVarOne = NULL;}
-               Scierror(999,_("%s: Memory allocation error.\n"),fname);
-               return 0;
-       }
-
-       for (i=0;i< m1 * n1; i++)
-       {
-               pStVarOne[i] = (wchar_t*)MALLOC(sizeof(wchar_t)* (lenStVarOne[i] + 1));
-               if (pStVarOne[i] == NULL)
-               {
-                       freeArrayOfWideString(pStVarOne, m1 * n1);
-                       if (lenStVarOne) {FREE(lenStVarOne); lenStVarOne = NULL;}
-                       Scierror(999,_("%s: Memory allocation error.\n"),fname);
-                       return 0;
-               }
-       }
-
-       sciErr = getMatrixOfWideString(_piKey, piAddressVarOne, &m1, &n1, lenStVarOne, pStVarOne);
-       if(sciErr.iErr)
-       {
-               printError(&sciErr, 0);
-               return 0;
-       }
-
-       for (i=0;i< m1 * n1; i++)
-       {
-               wchar_t *expandedPath = expandPathVariableW(pStVarOne[i]);
-               if (expandedPath)
-               {
-                       results[i] = !isdirW(expandedPath) && FileExistW(expandedPath);
-                       FREE(expandedPath); expandedPath = NULL;
-               }
-               else
-               {
-                       results[i] = FALSE;
-               }
-       }
-
-       if (lenStVarOne) {FREE(lenStVarOne); lenStVarOne = NULL;}
-       freeArrayOfWideString(pStVarOne, m1 * n1);
-
-       sciErr = createMatrixOfBoolean(_piKey, Rhs + 1, m1, n1, results);
-       if(sciErr.iErr)
-       {
-               printError(&sciErr, 0);
-               return 0;
-       }
-
-       LhsVar(1) = Rhs + 1;
-
-       if (results) {FREE(results); results = NULL;}
-       
-       C2F(putlhsvar)();
-       return 0;
-}
-/*--------------------------------------------------------------------------*/
index ea1882f..2575f6d 100644 (file)
@@ -37,5 +37,6 @@ bool FileioModule::Load()
     symbol::Context::getInstance()->AddFunction(Function::createFunction(L"fileparts", &sci_fileparts, MODULE_NAME));
     symbol::Context::getInstance()->AddFunction(Function::createFunction(L"findfiles", &sci_findfiles, MODULE_NAME));
     symbol::Context::getInstance()->AddFunction(Function::createFunction(L"basename", &sci_basename, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(Function::createFunction(L"isfile", &sci_isfile, MODULE_NAME));
     return true;
 }
index f43d7a5..511e37a 100644 (file)
                                >
                        </File>
                        <File
+                               RelativePath=".\sci_isfile.cpp"
+                               >
+                       </File>
+                       <File
                                RelativePath=".\sci_mclose.cpp"
                                >
                        </File>
diff --git a/scilab/modules/fileio/sci_gateway/cpp/sci_isfile.cpp b/scilab/modules/fileio/sci_gateway/cpp/sci_isfile.cpp
new file mode 100644 (file)
index 0000000..79fa1de
--- /dev/null
@@ -0,0 +1,189 @@
+/*
+* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+* Copyright (C) 2009 - DIGITEO - Allan CORNET
+*
+* 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
+*
+*/
+/*--------------------------------------------------------------------------*/
+#include "fileio_gw.hxx"
+
+extern "C"
+{
+#include "localization.h"
+#include "Scierror.h"
+#include "FileExist.h"
+#include "isdir.h"
+#include "expandPathVariable.h"
+}
+
+/*--------------------------------------------------------------------------*/
+Function::ReturnValue sci_isfile(typed_list &in, int _iRetCount, typed_list &out)
+{
+    if(in.size() != 1)
+    {
+        ScierrorW(999, _W("%ls: Wrong number of input arguments: %d expected.\n"), L"isfile" , 1);
+        return Function::Error;
+    }
+
+    if(_iRetCount != 1)
+    {
+        ScierrorW(78,_W("%ls: Wrong number of output argument(s): %d expected.\n"), L"isfile", 1);
+        return Function::Error;
+    }
+
+    if(in[0]->isString() == false)
+    {
+        ScierrorW(999, _W("%ls: Wrong type for input argument #%d: Matrix of strings expected.\n"), L"isfile", 1);
+        return Function::Error;
+    }
+
+    String* pS  = in[0]->getAsString();
+    Bool* pOut  = new Bool(pS->rows_get(), pS->cols_get());
+
+    for(int i = 0 ; i < pS->size_get() ; i++)
+    {
+        wchar_t *expandedPath = expandPathVariableW(pS->string_get(i));
+               if(expandedPath)
+               {
+            pOut->bool_get()[i] = !isdirW(expandedPath) && FileExistW(expandedPath);
+                       FREE(expandedPath);
+                       expandedPath = NULL;
+               }
+               else
+               {
+                       pOut->bool_get()[i] = FALSE;
+               }
+       }
+
+    out.push_back(pOut);
+    return Function::OK;
+       //SciErr sciErr;
+       //int *piAddressVarOne = NULL;
+       //wchar_t **pStVarOne = NULL;
+       //int iType = 0;
+       //int *lenStVarOne = NULL;
+       //int m1 = 0, n1 = 0;
+
+       //BOOL *results = NULL;
+       //int m_out = 0, n_out = 0;
+       //int i = 0;
+
+       ///* Check Input & Output parameters */
+       //CheckRhs(1,1);
+       //CheckLhs(1,1);
+
+       //sciErr = getVarAddressFromPosition(_piKey, 1, &piAddressVarOne);
+       //if(sciErr.iErr)
+       //{
+       //      printError(&sciErr, 0);
+       //      return 0;
+       //}
+
+       //sciErr = getVarType(_piKey, piAddressVarOne, &iType);
+       //if(sciErr.iErr)
+       //{
+       //      printError(&sciErr, 0);
+       //      return 0;
+       //}
+
+       //if (iType != sci_strings)
+       //{
+       //      Scierror(999,_("%s: Wrong type for input argument #%d: A string expected.\n"), fname, 1);
+       //      return 0;
+       //}
+
+       //sciErr = getVarDimension(_piKey, piAddressVarOne, &m1, &n1);
+       //if(sciErr.iErr)
+       //{
+       //      printError(&sciErr, 0);
+       //      return 0;
+       //}
+
+
+       //lenStVarOne = (int*)MALLOC(sizeof(int) * (m1 * n1));
+       //if (lenStVarOne == NULL)
+       //{
+       //      Scierror(999,_("%s: Memory allocation error.\n"),fname);
+       //      return 0;
+       //}
+
+       //results = (BOOL*)MALLOC(sizeof(BOOL) * (m1 * n1));
+       //if (results == NULL)
+       //{
+       //      if (lenStVarOne) {FREE(lenStVarOne); lenStVarOne = NULL;}
+       //      freeArrayOfWideString(pStVarOne, m1 * n1);
+       //      Scierror(999,_("%s: Memory allocation error.\n"),fname);
+       //      return 0;
+       //}
+
+       //sciErr = getMatrixOfWideString(_piKey, piAddressVarOne, &m1, &n1, lenStVarOne, pStVarOne);
+       //if(sciErr.iErr)
+       //{
+       //      printError(&sciErr, 0);
+       //      return 0;
+       //}
+
+       //pStVarOne = (wchar_t**)MALLOC(sizeof(wchar_t*) * (m1 * n1));
+       //if (pStVarOne == NULL)
+       //{
+       //      if (lenStVarOne) {FREE(lenStVarOne); lenStVarOne = NULL;}
+       //      Scierror(999,_("%s: Memory allocation error.\n"),fname);
+       //      return 0;
+       //}
+
+       //for (i=0;i< m1 * n1; i++)
+       //{
+       //      pStVarOne[i] = (wchar_t*)MALLOC(sizeof(wchar_t)* (lenStVarOne[i] + 1));
+       //      if (pStVarOne[i] == NULL)
+       //      {
+       //              freeArrayOfWideString(pStVarOne, m1 * n1);
+       //              if (lenStVarOne) {FREE(lenStVarOne); lenStVarOne = NULL;}
+       //              Scierror(999,_("%s: Memory allocation error.\n"),fname);
+       //              return 0;
+       //      }
+       //}
+
+       //sciErr = getMatrixOfWideString(_piKey, piAddressVarOne, &m1, &n1, lenStVarOne, pStVarOne);
+       //if(sciErr.iErr)
+       //{
+       //      printError(&sciErr, 0);
+       //      return 0;
+       //}
+
+       //for (i=0;i< m1 * n1; i++)
+       //{
+       //      wchar_t *expandedPath = expandPathVariableW(pStVarOne[i]);
+       //      if (expandedPath)
+       //      {
+       //              results[i] = !isdirW(expandedPath) && FileExistW(expandedPath);
+       //              FREE(expandedPath); expandedPath = NULL;
+       //      }
+       //      else
+       //      {
+       //              results[i] = FALSE;
+       //      }
+       //}
+
+       //if (lenStVarOne) {FREE(lenStVarOne); lenStVarOne = NULL;}
+       //freeArrayOfWideString(pStVarOne, m1 * n1);
+
+       //sciErr = createMatrixOfBoolean(_piKey, Rhs + 1, m1, n1, results);
+       //if(sciErr.iErr)
+       //{
+       //      printError(&sciErr, 0);
+       //      return 0;
+       //}
+
+       //LhsVar(1) = Rhs + 1;
+
+       //if (results) {FREE(results); results = NULL;}
+       //
+       //C2F(putlhsvar)();
+       //return 0;
+}
+/*--------------------------------------------------------------------------*/