mgetl and mputl 53/1553/2
antoine ELIAS [Fri, 6 Aug 2010 11:33:45 +0000 (13:33 +0200)]
Change-Id: I790bb3fe5fa1fa8e67946c3c602c58d33923e481

28 files changed:
scilab/Makefile.am
scilab/Makefile.in
scilab/Scilab.sln
scilab/modules/core/core_yasp.vcproj
scilab/modules/core/src/cpp/scilab.cpp
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/filemanager.hxx
scilab/modules/fileio/includes/gw_fileio.h
scilab/modules/fileio/sci_gateway/c/sci_mgetl.c [deleted file]
scilab/modules/fileio/sci_gateway/c/sci_mputl.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_mgetl.cpp [new file with mode: 0644]
scilab/modules/fileio/sci_gateway/cpp/sci_mopen.cpp
scilab/modules/fileio/sci_gateway/cpp/sci_mputl.cpp [new file with mode: 0644]
scilab/modules/fileio/src/c/findfiles.c
scilab/modules/fileio/src/c/isdir.c
scilab/modules/fileio/src/c/mputl.c [deleted file]
scilab/modules/fileio/src/cpp/filemanager.cpp
scilab/modules/fileio/src/cpp/mgetl.cpp [moved from scilab/modules/fileio/src/c/mgetl.c with 73% similarity]
scilab/modules/fileio/src/cpp/mgetl.h [moved from scilab/modules/fileio/src/c/mgetl.h with 94% similarity]
scilab/modules/fileio/src/cpp/mputl.cpp [new file with mode: 0644]
scilab/modules/fileio/src/cpp/mputl.h [moved from scilab/modules/fileio/src/c/mputl.h with 90% similarity]
scilab/modules/types/src/cpp/bool.cpp
scilab/modules/types/src/cpp/file.cpp

index 2d25384..35b9abb 100644 (file)
@@ -62,6 +62,7 @@ COMMON_CPPFLAGS =             -I$(top_srcdir)/modules/shell/includes/ \
                                                -I$(top_srcdir)/modules/system_env/includes/ \
                                                -I$(top_srcdir)/modules/operations/includes/ \
                                                -I$(top_srcdir)/modules/elementary_functions/includes/ \
+                                               -I$(top_srcdir)/modules/fileio/includes/ \
                                                -I$(top_srcdir)/modules/history_manager/includes/
 
 scilab_bin_SOURCES             =       $(top_srcdir)/modules/core/src/cpp/scilab.cpp \
index 6d061ea..40f313d 100644 (file)
@@ -622,6 +622,7 @@ COMMON_CPPFLAGS = -I$(top_srcdir)/modules/shell/includes/ \
                                                -I$(top_srcdir)/modules/system_env/includes/ \
                                                -I$(top_srcdir)/modules/operations/includes/ \
                                                -I$(top_srcdir)/modules/elementary_functions/includes/ \
+                                               -I$(top_srcdir)/modules/fileio/includes/ \
                                                -I$(top_srcdir)/modules/history_manager/includes/
 
 scilab_bin_SOURCES = $(top_srcdir)/modules/core/src/cpp/scilab.cpp \
index 8e7d997..9a24ab3 100644 (file)
@@ -1299,6 +1299,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "core_yasp", "modules\core\c
                {2C60033B-0DBD-4CA4-80D3-176C9BE9CE2F} = {2C60033B-0DBD-4CA4-80D3-176C9BE9CE2F}
                {E1284D3E-4B3F-446B-B541-F661A8A166A7} = {E1284D3E-4B3F-446B-B541-F661A8A166A7}
                {805AA73F-EF7B-4177-BF46-200B72D8F83A} = {805AA73F-EF7B-4177-BF46-200B72D8F83A}
+               {4FC72D4A-80EE-4B1A-8724-0201C1A35621} = {4FC72D4A-80EE-4B1A-8724-0201C1A35621}
                {0D3FA25B-8116-44EC-A45E-260789DAA3D9} = {0D3FA25B-8116-44EC-A45E-260789DAA3D9}
                {64BC155E-292F-484F-9404-76EE6AE67A43} = {64BC155E-292F-484F-9404-76EE6AE67A43}
                {8028F371-6A94-4A26-8804-6E7F05F1D1AA} = {8028F371-6A94-4A26-8804-6E7F05F1D1AA}
index 5e39fd9..bef8e03 100644 (file)
@@ -44,7 +44,7 @@
                        <Tool
                                Name="VCCLCompilerTool"
                                Optimization="0"
-                               AdditionalIncludeDirectories="includes;..\parse\includes;..\abstractSyntaxTree\includes;..\symbol\includes;..\types\includes;..\functions_manager\includes;..\system_env\includes;..\elementary_functions\includes;../operations/includes;../localization/includes;..\windows_tools\includes;&quot;$(SolutionDir)libs\MALLOC\includes&quot;;../shell/includes;&quot;$(SolutionDir)libs\intl&quot;;../console/includes;../output_stream/includes;../history_manager/includes"
+                               AdditionalIncludeDirectories="includes;..\parse\includes;..\abstractSyntaxTree\includes;..\symbol\includes;..\types\includes;..\functions_manager\includes;..\system_env\includes;..\elementary_functions\includes;../operations/includes;../localization/includes;..\windows_tools\includes;&quot;$(SolutionDir)libs\MALLOC\includes&quot;;../shell/includes;&quot;$(SolutionDir)libs\intl&quot;;../console/includes;../output_stream/includes;../history_manager/includes;../fileio/includes"
                                PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;__CORE_YASP__"
                                MinimalRebuild="true"
                                BasicRuntimeChecks="3"
                        <Tool
                                Name="VCCLCompilerTool"
                                Optimization="0"
-                               AdditionalIncludeDirectories="includes;..\parse\includes;..\abstractSyntaxTree\includes;..\symbol\includes;..\types\includes;..\functions_manager\includes;..\system_env\includes;..\elementary_functions\includes;../operations/includes;../localization/includes;..\windows_tools\includes;&quot;$(SolutionDir)libs\MALLOC\includes&quot;;../shell/includes;&quot;$(SolutionDir)libs\intl&quot;;../console/includes;../output_stream/includes;../history_manager/includes"
+                               AdditionalIncludeDirectories="includes;..\parse\includes;..\abstractSyntaxTree\includes;..\symbol\includes;..\types\includes;..\functions_manager\includes;..\system_env\includes;..\elementary_functions\includes;../operations/includes;../localization/includes;..\windows_tools\includes;&quot;$(SolutionDir)libs\MALLOC\includes&quot;;../shell/includes;&quot;$(SolutionDir)libs\intl&quot;;../console/includes;../output_stream/includes;../history_manager/includes;../fileio/includes"
                                PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;__CORE_YASP__"
                                MinimalRebuild="true"
                                BasicRuntimeChecks="3"
                        />
                        <Tool
                                Name="VCCLCompilerTool"
-                               AdditionalIncludeDirectories="includes;..\parse\includes;..\abstractSyntaxTree\includes;..\symbol\includes;..\types\includes;..\functions_manager\includes;..\system_env\includes;..\elementary_functions\includes;../operations/includes;../localization/includes;..\windows_tools\includes;&quot;$(SolutionDir)libs\MALLOC\includes&quot;;../shell/includes;&quot;$(SolutionDir)libs\intl&quot;;../console/includes;../output_stream/includes;../history_manager/includes"
+                               AdditionalIncludeDirectories="includes;..\parse\includes;..\abstractSyntaxTree\includes;..\symbol\includes;..\types\includes;..\functions_manager\includes;..\system_env\includes;..\elementary_functions\includes;../operations/includes;../localization/includes;..\windows_tools\includes;&quot;$(SolutionDir)libs\MALLOC\includes&quot;;../shell/includes;&quot;$(SolutionDir)libs\intl&quot;;../console/includes;../output_stream/includes;../history_manager/includes;../fileio/includes"
                                PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;__CORE_YASP__"
                                RuntimeLibrary="2"
                                UsePrecompiledHeader="0"
                        />
                        <Tool
                                Name="VCCLCompilerTool"
-                               AdditionalIncludeDirectories="includes;..\parse\includes;..\abstractSyntaxTree\includes;..\symbol\includes;..\types\includes;..\functions_manager\includes;..\system_env\includes;..\elementary_functions\includes;../operations/includes;../localization/includes;..\windows_tools\includes;&quot;$(SolutionDir)libs\MALLOC\includes&quot;;../shell/includes;&quot;$(SolutionDir)libs\intl&quot;;../console/includes;../output_stream/includes;../history_manager/includes"
+                               AdditionalIncludeDirectories="includes;..\parse\includes;..\abstractSyntaxTree\includes;..\symbol\includes;..\types\includes;..\functions_manager\includes;..\system_env\includes;..\elementary_functions\includes;../operations/includes;../localization/includes;..\windows_tools\includes;&quot;$(SolutionDir)libs\MALLOC\includes&quot;;../shell/includes;&quot;$(SolutionDir)libs\intl&quot;;../console/includes;../output_stream/includes;../history_manager/includes;../fileio/includes"
                                PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;__CORE_YASP__"
                                RuntimeLibrary="2"
                                UsePrecompiledHeader="0"
index 494cd60..e027c29 100644 (file)
@@ -73,6 +73,7 @@ extern "C"
 #include "setenvvar.hxx"
 #include "funcmanager.hxx"
 #include "configvariable.hxx"
+#include "filemanager.hxx"
 
 #include "banner.hxx"
 
@@ -540,6 +541,7 @@ int InitializeEnvironnement(void)
     ConfigVariable::setConsoleWidth(75);
     ConfigVariable::setFormat(16);
     Add_All_Variables();
+    FileManager::initialize();
     return 0;
 }
 
index bdb4d6d..ee4c8b2 100644 (file)
@@ -18,7 +18,6 @@ src/c/getfiletype.c \
 src/c/mclearerr.c \
 src/c/meof.c \
 src/c/merror.c \
-src/c/mgetl.c \
 src/c/mgeti.c \
 src/c/mgetstr.c \
 src/c/mputi.c \
@@ -47,8 +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/mputl.c
+src/c/os_wfopen.c 
 
 GATEWAY_C_SOURCES = \
 sci_gateway/c/gw_fileio.c \
@@ -75,7 +73,6 @@ sci_gateway/c/sci_chdir.c \
 sci_gateway/c/sci_pwd.c \
 sci_gateway/c/sci_mclearerr.c \
 sci_gateway/c/sci_merror.c \
-sci_gateway/c/sci_mgetl.c \
 sci_gateway/c/sci_mgetstr.c \
 sci_gateway/c/sci_moef.c \
 sci_gateway/c/sci_mputstr.c \
@@ -90,15 +87,16 @@ sci_gateway/c/sci_fileparts.c \
 sci_gateway/c/sci_movefile.c \
 sci_gateway/c/sci_basename.c \
 sci_gateway/c/sci_pathconvert.c \
-sci_gateway/c/sci_isfile.c \
-sci_gateway/c/sci_mputl.c
+sci_gateway/c/sci_isfile.c
 
 GATEWAY_CPP_SOURCES = \
        sci_gateway/cpp/fileio_gw.cpp \
        sci_gateway/cpp/sci_mopen.cpp \
        sci_gateway/cpp/sci_mclose.cpp \
        sci_gateway/cpp/sci_mget.cpp \
-       sci_gateway/cpp/sci_mput.cpp
+       sci_gateway/cpp/sci_mput.cpp \
+       sci_gateway/cpp/sci_mputl.cpp \
+       sci_gateway/cpp/sci_mgetl.cpp
 
 FILEIO_CPP_SOURCES = \
        src/cpp/expandPathVariable.cpp \
@@ -106,11 +104,14 @@ FILEIO_CPP_SOURCES = \
        src/cpp/mclose.cpp \
        src/cpp/mput.cpp \
        src/cpp/mget.cpp \
+       src/cpp/mputl.cpp \
+       src/cpp/mgetl.cpp \
        src/cpp/filemanager.cpp
 
 
 libscifileio_la_CPPFLAGS=      -I$(srcdir)/includes/ \
                                -I$(srcdir)/src/c/ \
+                               -I$(srcdir)/src/cpp/ \
                                -I$(top_srcdir)/libs/MALLOC/includes/ \
                                -I$(top_srcdir)/modules/api_scilab/includes \
                                -I$(top_srcdir)/modules/output_stream/includes \
@@ -121,6 +122,7 @@ libscifileio_la_CPPFLAGS=   -I$(srcdir)/includes/ \
                                -I$(top_srcdir)/modules/symbol/includes \
                                -I$(top_srcdir)/modules/string/includes \
                                -I$(top_srcdir)/modules/system_env/includes \
+                               -I$(top_srcdir)/modules/io/includes \
                                $(HDF5_CFLAGS)
 
 libscifileio_la_CFLAGS=                -I$(srcdir)/includes/ \
index 1e55f37..b7634b6 100644 (file)
@@ -125,11 +125,11 @@ am__objects_1 = libscifileio_la-FileExist.lo \
        libscifileio_la-getfiledesc.lo libscifileio_la-getfileinfo.lo \
        libscifileio_la-getfiletype.lo libscifileio_la-mclearerr.lo \
        libscifileio_la-meof.lo libscifileio_la-merror.lo \
-       libscifileio_la-mgetl.lo libscifileio_la-mgeti.lo \
-       libscifileio_la-mgetstr.lo libscifileio_la-mputi.lo \
-       libscifileio_la-mputstr.lo libscifileio_la-mseek.lo \
-       libscifileio_la-mtell.lo libscifileio_la-readline.lo \
-       libscifileio_la-getdrives.lo libscifileio_la-deleteafile.lo \
+       libscifileio_la-mgeti.lo libscifileio_la-mgetstr.lo \
+       libscifileio_la-mputi.lo libscifileio_la-mputstr.lo \
+       libscifileio_la-mseek.lo libscifileio_la-mtell.lo \
+       libscifileio_la-readline.lo libscifileio_la-getdrives.lo \
+       libscifileio_la-deleteafile.lo \
        libscifileio_la-getshortpathname.lo \
        libscifileio_la-getlongpathname.lo \
        libscifileio_la-FindFileExtension.lo \
@@ -143,10 +143,11 @@ am__objects_1 = libscifileio_la-FileExist.lo \
        libscifileio_la-basename.lo libscifileio_la-pathconvert.lo \
        libscifileio_la-copyfile_others.lo \
        libscifileio_la-getFullFilename.lo \
-       libscifileio_la-os_wfopen.lo libscifileio_la-mputl.lo
+       libscifileio_la-os_wfopen.lo
 am__objects_2 = libscifileio_la-expandPathVariable.lo \
        libscifileio_la-mopen.lo libscifileio_la-mclose.lo \
        libscifileio_la-mput.lo libscifileio_la-mget.lo \
+       libscifileio_la-mputl.lo libscifileio_la-mgetl.lo \
        libscifileio_la-filemanager.lo
 am__objects_3 = libscifileio_la-gw_fileio.lo \
        libscifileio_la-sci_mfprintf.lo libscifileio_la-sci_mscanf.lo \
@@ -165,11 +166,10 @@ am__objects_3 = libscifileio_la-gw_fileio.lo \
        libscifileio_la-sci_removedir.lo \
        libscifileio_la-sci_createdir.lo libscifileio_la-sci_chdir.lo \
        libscifileio_la-sci_pwd.lo libscifileio_la-sci_mclearerr.lo \
-       libscifileio_la-sci_merror.lo libscifileio_la-sci_mgetl.lo \
-       libscifileio_la-sci_mgetstr.lo libscifileio_la-sci_moef.lo \
-       libscifileio_la-sci_mputstr.lo libscifileio_la-sci_mseek.lo \
-       libscifileio_la-sci_mtell.lo libscifileio_la-sci_fileinfo.lo \
-       libscifileio_la-sci_newest.lo \
+       libscifileio_la-sci_merror.lo libscifileio_la-sci_mgetstr.lo \
+       libscifileio_la-sci_moef.lo libscifileio_la-sci_mputstr.lo \
+       libscifileio_la-sci_mseek.lo libscifileio_la-sci_mtell.lo \
+       libscifileio_la-sci_fileinfo.lo libscifileio_la-sci_newest.lo \
        libscifileio_la-sci_get_absolute_file_path.lo \
        libscifileio_la-sci_getrelativefilename.lo \
        libscifileio_la-sci_copyfile.lo \
@@ -177,10 +177,11 @@ am__objects_3 = libscifileio_la-gw_fileio.lo \
        libscifileio_la-sci_movefile.lo \
        libscifileio_la-sci_basename.lo \
        libscifileio_la-sci_pathconvert.lo \
-       libscifileio_la-sci_isfile.lo libscifileio_la-sci_mputl.lo
+       libscifileio_la-sci_isfile.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
+       libscifileio_la-sci_mget.lo libscifileio_la-sci_mput.lo \
+       libscifileio_la-sci_mputl.lo libscifileio_la-sci_mgetl.lo
 am_libscifileio_la_OBJECTS = $(am__objects_1) $(am__objects_2) \
        $(am__objects_3) $(am__objects_4)
 libscifileio_la_OBJECTS = $(am_libscifileio_la_OBJECTS)
@@ -480,7 +481,6 @@ src/c/getfiletype.c \
 src/c/mclearerr.c \
 src/c/meof.c \
 src/c/merror.c \
-src/c/mgetl.c \
 src/c/mgeti.c \
 src/c/mgetstr.c \
 src/c/mputi.c \
@@ -509,8 +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/mputl.c
+src/c/os_wfopen.c 
 
 GATEWAY_C_SOURCES = \
 sci_gateway/c/gw_fileio.c \
@@ -537,7 +536,6 @@ sci_gateway/c/sci_chdir.c \
 sci_gateway/c/sci_pwd.c \
 sci_gateway/c/sci_mclearerr.c \
 sci_gateway/c/sci_merror.c \
-sci_gateway/c/sci_mgetl.c \
 sci_gateway/c/sci_mgetstr.c \
 sci_gateway/c/sci_moef.c \
 sci_gateway/c/sci_mputstr.c \
@@ -552,15 +550,16 @@ sci_gateway/c/sci_fileparts.c \
 sci_gateway/c/sci_movefile.c \
 sci_gateway/c/sci_basename.c \
 sci_gateway/c/sci_pathconvert.c \
-sci_gateway/c/sci_isfile.c \
-sci_gateway/c/sci_mputl.c
+sci_gateway/c/sci_isfile.c
 
 GATEWAY_CPP_SOURCES = \
        sci_gateway/cpp/fileio_gw.cpp \
        sci_gateway/cpp/sci_mopen.cpp \
        sci_gateway/cpp/sci_mclose.cpp \
        sci_gateway/cpp/sci_mget.cpp \
-       sci_gateway/cpp/sci_mput.cpp
+       sci_gateway/cpp/sci_mput.cpp \
+       sci_gateway/cpp/sci_mputl.cpp \
+       sci_gateway/cpp/sci_mgetl.cpp
 
 FILEIO_CPP_SOURCES = \
        src/cpp/expandPathVariable.cpp \
@@ -568,10 +567,13 @@ FILEIO_CPP_SOURCES = \
        src/cpp/mclose.cpp \
        src/cpp/mput.cpp \
        src/cpp/mget.cpp \
+       src/cpp/mputl.cpp \
+       src/cpp/mgetl.cpp \
        src/cpp/filemanager.cpp
 
 libscifileio_la_CPPFLAGS = -I$(srcdir)/includes/ \
                                -I$(srcdir)/src/c/ \
+                               -I$(srcdir)/src/cpp/ \
                                -I$(top_srcdir)/libs/MALLOC/includes/ \
                                -I$(top_srcdir)/modules/api_scilab/includes \
                                -I$(top_srcdir)/modules/output_stream/includes \
@@ -582,6 +584,7 @@ libscifileio_la_CPPFLAGS = -I$(srcdir)/includes/ \
                                -I$(top_srcdir)/modules/symbol/includes \
                                -I$(top_srcdir)/modules/string/includes \
                                -I$(top_srcdir)/modules/system_env/includes \
+                               -I$(top_srcdir)/modules/io/includes \
                                $(HDF5_CFLAGS)
 
 libscifileio_la_CFLAGS = -I$(srcdir)/includes/ \
@@ -980,13 +983,6 @@ libscifileio_la-merror.lo: src/c/merror.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-merror.lo `test -f 'src/c/merror.c' || echo '$(srcdir)/'`src/c/merror.c
 
-libscifileio_la-mgetl.lo: src/c/mgetl.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-mgetl.lo -MD -MP -MF $(DEPDIR)/libscifileio_la-mgetl.Tpo -c -o libscifileio_la-mgetl.lo `test -f 'src/c/mgetl.c' || echo '$(srcdir)/'`src/c/mgetl.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscifileio_la-mgetl.Tpo $(DEPDIR)/libscifileio_la-mgetl.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/mgetl.c' object='libscifileio_la-mgetl.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-mgetl.lo `test -f 'src/c/mgetl.c' || echo '$(srcdir)/'`src/c/mgetl.c
-
 libscifileio_la-mgeti.lo: src/c/mgeti.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-mgeti.lo -MD -MP -MF $(DEPDIR)/libscifileio_la-mgeti.Tpo -c -o libscifileio_la-mgeti.lo `test -f 'src/c/mgeti.c' || echo '$(srcdir)/'`src/c/mgeti.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscifileio_la-mgeti.Tpo $(DEPDIR)/libscifileio_la-mgeti.Plo
@@ -1190,13 +1186,6 @@ libscifileio_la-os_wfopen.lo: src/c/os_wfopen.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-os_wfopen.lo `test -f 'src/c/os_wfopen.c' || echo '$(srcdir)/'`src/c/os_wfopen.c
 
-libscifileio_la-mputl.lo: src/c/mputl.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-mputl.lo -MD -MP -MF $(DEPDIR)/libscifileio_la-mputl.Tpo -c -o libscifileio_la-mputl.lo `test -f 'src/c/mputl.c' || echo '$(srcdir)/'`src/c/mputl.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscifileio_la-mputl.Tpo $(DEPDIR)/libscifileio_la-mputl.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/mputl.c' object='libscifileio_la-mputl.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-mputl.lo `test -f 'src/c/mputl.c' || echo '$(srcdir)/'`src/c/mputl.c
-
 libscifileio_la-gw_fileio.lo: sci_gateway/c/gw_fileio.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-gw_fileio.lo -MD -MP -MF $(DEPDIR)/libscifileio_la-gw_fileio.Tpo -c -o libscifileio_la-gw_fileio.lo `test -f 'sci_gateway/c/gw_fileio.c' || echo '$(srcdir)/'`sci_gateway/c/gw_fileio.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscifileio_la-gw_fileio.Tpo $(DEPDIR)/libscifileio_la-gw_fileio.Plo
@@ -1365,13 +1354,6 @@ libscifileio_la-sci_merror.lo: sci_gateway/c/sci_merror.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_merror.lo `test -f 'sci_gateway/c/sci_merror.c' || echo '$(srcdir)/'`sci_gateway/c/sci_merror.c
 
-libscifileio_la-sci_mgetl.lo: sci_gateway/c/sci_mgetl.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_mgetl.lo -MD -MP -MF $(DEPDIR)/libscifileio_la-sci_mgetl.Tpo -c -o libscifileio_la-sci_mgetl.lo `test -f 'sci_gateway/c/sci_mgetl.c' || echo '$(srcdir)/'`sci_gateway/c/sci_mgetl.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscifileio_la-sci_mgetl.Tpo $(DEPDIR)/libscifileio_la-sci_mgetl.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/sci_mgetl.c' object='libscifileio_la-sci_mgetl.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_mgetl.lo `test -f 'sci_gateway/c/sci_mgetl.c' || echo '$(srcdir)/'`sci_gateway/c/sci_mgetl.c
-
 libscifileio_la-sci_mgetstr.lo: sci_gateway/c/sci_mgetstr.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_mgetstr.lo -MD -MP -MF $(DEPDIR)/libscifileio_la-sci_mgetstr.Tpo -c -o libscifileio_la-sci_mgetstr.lo `test -f 'sci_gateway/c/sci_mgetstr.c' || echo '$(srcdir)/'`sci_gateway/c/sci_mgetstr.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscifileio_la-sci_mgetstr.Tpo $(DEPDIR)/libscifileio_la-sci_mgetstr.Plo
@@ -1477,13 +1459,6 @@ libscifileio_la-sci_isfile.lo: sci_gateway/c/sci_isfile.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_isfile.lo `test -f 'sci_gateway/c/sci_isfile.c' || echo '$(srcdir)/'`sci_gateway/c/sci_isfile.c
 
-libscifileio_la-sci_mputl.lo: sci_gateway/c/sci_mputl.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_mputl.lo -MD -MP -MF $(DEPDIR)/libscifileio_la-sci_mputl.Tpo -c -o libscifileio_la-sci_mputl.lo `test -f 'sci_gateway/c/sci_mputl.c' || echo '$(srcdir)/'`sci_gateway/c/sci_mputl.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscifileio_la-sci_mputl.Tpo $(DEPDIR)/libscifileio_la-sci_mputl.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/sci_mputl.c' object='libscifileio_la-sci_mputl.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_mputl.lo `test -f 'sci_gateway/c/sci_mputl.c' || echo '$(srcdir)/'`sci_gateway/c/sci_mputl.c
-
 .cpp.o:
 @am__fastdepCXX_TRUE@  $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
 @am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@@ -1540,6 +1515,20 @@ libscifileio_la-mget.lo: src/cpp/mget.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-mget.lo `test -f 'src/cpp/mget.cpp' || echo '$(srcdir)/'`src/cpp/mget.cpp
 
+libscifileio_la-mputl.lo: src/cpp/mputl.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-mputl.lo -MD -MP -MF $(DEPDIR)/libscifileio_la-mputl.Tpo -c -o libscifileio_la-mputl.lo `test -f 'src/cpp/mputl.cpp' || echo '$(srcdir)/'`src/cpp/mputl.cpp
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscifileio_la-mputl.Tpo $(DEPDIR)/libscifileio_la-mputl.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='src/cpp/mputl.cpp' object='libscifileio_la-mputl.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-mputl.lo `test -f 'src/cpp/mputl.cpp' || echo '$(srcdir)/'`src/cpp/mputl.cpp
+
+libscifileio_la-mgetl.lo: src/cpp/mgetl.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-mgetl.lo -MD -MP -MF $(DEPDIR)/libscifileio_la-mgetl.Tpo -c -o libscifileio_la-mgetl.lo `test -f 'src/cpp/mgetl.cpp' || echo '$(srcdir)/'`src/cpp/mgetl.cpp
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscifileio_la-mgetl.Tpo $(DEPDIR)/libscifileio_la-mgetl.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='src/cpp/mgetl.cpp' object='libscifileio_la-mgetl.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-mgetl.lo `test -f 'src/cpp/mgetl.cpp' || echo '$(srcdir)/'`src/cpp/mgetl.cpp
+
 libscifileio_la-filemanager.lo: src/cpp/filemanager.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-filemanager.lo -MD -MP -MF $(DEPDIR)/libscifileio_la-filemanager.Tpo -c -o libscifileio_la-filemanager.lo `test -f 'src/cpp/filemanager.cpp' || echo '$(srcdir)/'`src/cpp/filemanager.cpp
 @am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscifileio_la-filemanager.Tpo $(DEPDIR)/libscifileio_la-filemanager.Plo
@@ -1582,6 +1571,20 @@ libscifileio_la-sci_mput.lo: sci_gateway/cpp/sci_mput.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_mput.lo `test -f 'sci_gateway/cpp/sci_mput.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_mput.cpp
 
+libscifileio_la-sci_mputl.lo: sci_gateway/cpp/sci_mputl.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_mputl.lo -MD -MP -MF $(DEPDIR)/libscifileio_la-sci_mputl.Tpo -c -o libscifileio_la-sci_mputl.lo `test -f 'sci_gateway/cpp/sci_mputl.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_mputl.cpp
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscifileio_la-sci_mputl.Tpo $(DEPDIR)/libscifileio_la-sci_mputl.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='sci_gateway/cpp/sci_mputl.cpp' object='libscifileio_la-sci_mputl.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_mputl.lo `test -f 'sci_gateway/cpp/sci_mputl.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_mputl.cpp
+
+libscifileio_la-sci_mgetl.lo: sci_gateway/cpp/sci_mgetl.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_mgetl.lo -MD -MP -MF $(DEPDIR)/libscifileio_la-sci_mgetl.Tpo -c -o libscifileio_la-sci_mgetl.lo `test -f 'sci_gateway/cpp/sci_mgetl.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_mgetl.cpp
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscifileio_la-sci_mgetl.Tpo $(DEPDIR)/libscifileio_la-sci_mgetl.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='sci_gateway/cpp/sci_mgetl.cpp' object='libscifileio_la-sci_mgetl.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_mgetl.lo `test -f 'sci_gateway/cpp/sci_mgetl.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_mgetl.cpp
+
 mostlyclean-libtool:
        -rm -f *.lo
 
index 65869ef..b47a142 100644 (file)
@@ -45,7 +45,7 @@
                                Name="VCCLCompilerTool"
                                AdditionalOptions=""
                                Optimization="0"
-                               AdditionalIncludeDirectories="includes;src/c;../../libs/MALLOC/includes;../windows_tools/includes;../api_scilab/includes;../core/includes;../string/includes;../output_stream/includes;../io/includes;../localization/includes;../../libs/intl;../operations/includes;../symbol/includes;../types/includes;../abstractSyntaxTree/includes;../system_env/includes"
+                               AdditionalIncludeDirectories="includes;src/c;src/cpp;../../libs/MALLOC/includes;../windows_tools/includes;../api_scilab/includes;../core/includes;../string/includes;../output_stream/includes;../io/includes;../localization/includes;../../libs/intl;../operations/includes;../symbol/includes;../types/includes;../abstractSyntaxTree/includes;../system_env/includes"
                                PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;FORDLL;_DEBUG;_WINDOWS;_USRDLL;FILEIO_EXPORTS"
                                MinimalRebuild="true"
                                BasicRuntimeChecks="0"
                        <Tool
                                Name="VCCLCompilerTool"
                                Optimization="0"
-                               AdditionalIncludeDirectories="includes;src/c;../../libs/MALLOC/includes;../windows_tools/includes;../api_scilab/includes;../core/includes;../string/includes;../output_stream/includes;../io/includes;../localization/includes;../../libs/intl;../operations/includes;../symbol/includes;../types/includes;../abstractSyntaxTree/includes;../system_env/includes"
+                               AdditionalIncludeDirectories="includes;src/c;src/cpp;../../libs/MALLOC/includes;../windows_tools/includes;../api_scilab/includes;../core/includes;../string/includes;../output_stream/includes;../io/includes;../localization/includes;../../libs/intl;../operations/includes;../symbol/includes;../types/includes;../abstractSyntaxTree/includes;../system_env/includes"
                                PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;FORDLL;_DEBUG;_WINDOWS;_USRDLL;FILEIO_EXPORTS"
                                MinimalRebuild="true"
                                BasicRuntimeChecks="0"
                                InlineFunctionExpansion="1"
                                FavorSizeOrSpeed="1"
                                WholeProgramOptimization="false"
-                               AdditionalIncludeDirectories="includes;src/c;../../libs/MALLOC/includes;../windows_tools/includes;../api_scilab/includes;../core/includes;../string/includes;../output_stream/includes;../io/includes;../localization/includes;../../libs/intl;../operations/includes;../symbol/includes;../types/includes;../abstractSyntaxTree/includes;../system_env/includes"
+                               AdditionalIncludeDirectories="includes;src/c;src/cpp;../../libs/MALLOC/includes;../windows_tools/includes;../api_scilab/includes;../core/includes;../string/includes;../output_stream/includes;../io/includes;../localization/includes;../../libs/intl;../operations/includes;../symbol/includes;../types/includes;../abstractSyntaxTree/includes;../system_env/includes"
                                PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;FORDLL;NDEBUG;_WINDOWS;_USRDLL;FILEIO_EXPORTS"
                                StringPooling="true"
                                RuntimeLibrary="2"
                                InlineFunctionExpansion="1"
                                FavorSizeOrSpeed="1"
                                WholeProgramOptimization="false"
-                               AdditionalIncludeDirectories="includes;src/c;../../libs/MALLOC/includes;../windows_tools/includes;../api_scilab/includes;../core/includes;../string/includes;../output_stream/includes;../io/includes;../localization/includes;../../libs/intl;../operations/includes;../symbol/includes;../types/includes;../abstractSyntaxTree/includes;../system_env/includes"
+                               AdditionalIncludeDirectories="includes;src/c;src/cpp;../../libs/MALLOC/includes;../windows_tools/includes;../api_scilab/includes;../core/includes;../string/includes;../output_stream/includes;../io/includes;../localization/includes;../../libs/intl;../operations/includes;../symbol/includes;../types/includes;../abstractSyntaxTree/includes;../system_env/includes"
                                PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;FORDLL;NDEBUG;_WINDOWS;_USRDLL;FILEIO_EXPORTS"
                                StringPooling="true"
                                RuntimeLibrary="2"
                                >
                        </File>
                        <File
-                               RelativePath=".\src\c\mgetl.c"
+                               RelativePath=".\src\cpp\mgetl.cpp"
                                >
                        </File>
                        <File
                                >
                        </File>
                        <File
+                               RelativePath=".\src\cpp\mputl.cpp"
+                               >
+                       </File>
+                       <File
                                RelativePath=".\src\c\mputstr.c"
                                >
                        </File>
                                >
                        </File>
                        <File
-                               RelativePath=".\sci_gateway\c\sci_mgetl.c"
-                               >
-                       </File>
-                       <File
                                RelativePath=".\sci_gateway\c\sci_mgetstr.c"
                                >
                        </File>
                                >
                        </File>
                        <File
-                               RelativePath=".\src\c\mgetl.h"
+                               RelativePath=".\src\cpp\mgetl.h"
                                >
                        </File>
                        <File
                                >
                        </File>
                        <File
+                               RelativePath=".\src\cpp\mputl.h"
+                               >
+                       </File>
+                       <File
                                RelativePath=".\src\c\mputstr.h"
                                >
                        </File>
index f42a381..256b78b 100644 (file)
@@ -40,5 +40,7 @@ CPP_GATEWAY_PROTOTYPE(sci_mopen);
 CPP_GATEWAY_PROTOTYPE(sci_mclose);
 CPP_GATEWAY_PROTOTYPE(sci_mput);
 CPP_GATEWAY_PROTOTYPE(sci_mget);
+CPP_GATEWAY_PROTOTYPE(sci_mputl);
+CPP_GATEWAY_PROTOTYPE(sci_mgetl);
 
 #endif /* !__FILEIO_GW_HXX__ */
index 7b627e7..7047ad1 100644 (file)
@@ -41,6 +41,7 @@ public :
     static double*              getSwaps();
     static int*                 getIDs();
 
+    static void                 initialize();
 private :
     static std::vector<File*>   m_fileList;
     static int                  m_iCurrentFile;     //memorize current using file
index 54fd801..fb25024 100644 (file)
@@ -50,7 +50,7 @@ FILEIO_IMPEXP int sci_fileinfo(char *fname,unsigned long fname_len);
 FILEIO_IMPEXP int sci_newest(char *fname,unsigned long fname_len);
 FILEIO_IMPEXP int sci_getrelativefilename(char *fname, unsigned long l);
 FILEIO_IMPEXP int sci_get_absolute_file_path(char *fname,unsigned long fname_len);
-FILEIO_IMPEXP int sci_mgetl(char *fname, int* _piKey);
+//FILEIO_IMPEXP int sci_mgetl(char *fname,unsigned long fname_len);
 
 //YaSp
 FILEIO_IMPEXP int sci_pwd(char *fname, int* _piKey);
diff --git a/scilab/modules/fileio/sci_gateway/c/sci_mgetl.c b/scilab/modules/fileio/sci_gateway/c/sci_mgetl.c
deleted file mode 100644 (file)
index e94496a..0000000
+++ /dev/null
@@ -1,302 +0,0 @@
-/*
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) 2006 - INRIA - Allan CORNET
- * Copyright (C) 2010 - 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 "localization.h"
-#include "Scierror.h"
-#include "api_scilab.h"
-#include "mgetl.h"
-#include "mopen.h"
-#include "mclose.h"
-#include "expandPathVariable.h"
-#include "filesmanagement.h"
-#include "freeArrayOfString.h"
-#include "BOOL.h"
-/*--------------------------------------------------------------------------*/
-int sci_mgetl(char *fname,int* _piKey)
-{
-    SciErr sciErr;
-    int *piAddressVarOne = NULL;
-    int numberOfLinesToRead = -1;
-
-    Rhs = Max(0, Rhs);
-
-    CheckRhs(1, 2);
-    CheckLhs(1, 1);
-
-    if (Rhs == 2)
-    {
-        int *piAddressVarTwo = NULL;
-
-        sciErr = getVarAddressFromPosition(_piKey, 2, &piAddressVarTwo);
-        if(sciErr.iErr)
-        {
-            printError(&sciErr, 0);
-            return 0;
-        }
-
-        if ( isDoubleType(_piKey, piAddressVarTwo) )
-        {
-            double dValue = 0.;
-            if (!isScalar(_piKey, piAddressVarTwo))
-            {
-                Scierror(999,_("%s: Wrong size for input argument #%d: Integer expected.\n"), fname, 2);
-                return 0;
-            }
-
-            if ( getScalarDouble(_piKey, piAddressVarTwo, &dValue) == 0)
-            {
-                numberOfLinesToRead = (int)dValue;
-            }
-            else
-            {
-                Scierror(999,_("%s: Memory allocation error.\n"), fname);
-                return 0;
-            }
-        }
-        else
-        {
-            Scierror(999,_("%s: Wrong type for input argument #%d: Integer expected.\n"), fname, 2);
-            return 0;
-        }
-    }
-
-    sciErr = getVarAddressFromPosition(_piKey, 1, &piAddressVarOne);
-    if(sciErr.iErr)
-    {
-        printError(&sciErr, 0);
-        return 0;
-    }
-
-    if ( isStringType(_piKey, piAddressVarOne) || isDoubleType(_piKey, piAddressVarOne) )
-    {
-        char **wcReadedStrings = NULL;
-        int numberOfLinesReaded = 0;
-        int fileDescriptor = -1;
-        int iErrorMgetl = 0;
-        BOOL bCloseFile = FALSE;
-
-        if (!isScalar(_piKey, piAddressVarOne))
-        {
-            Scierror(999,_("%s: Wrong size for input argument #%d: String or logical unit expected.\n"), fname, 1);
-            return 0;
-        }
-
-        if (isStringType(_piKey, piAddressVarOne))
-        {
-            char *fileName = NULL;
-            if (getAllocatedSingleString(_piKey, piAddressVarOne, &fileName) == 0)
-            {
-                char *expandedFileName = expandPathVariable(fileName);
-                freeAllocatedSingleString(fileName);
-                fileName = NULL;
-
-                if (IsAlreadyOpenedInScilab(expandedFileName))
-                {
-                    int fd = GetIdFromFilename(expandedFileName);
-                    fileDescriptor = fd;
-                    if (expandedFileName) {FREE(expandedFileName); expandedFileName = NULL;}
-                    bCloseFile = FALSE;
-                }
-                else
-                {
-                    #define READ_ONLY_TEXT_MODE "rt"
-                    int fd = 0;
-                    int f_swap = 0;
-                    double res = 0.0;
-                    int ierr = 0;
-
-                    C2F(mopen)(&fd, expandedFileName, READ_ONLY_TEXT_MODE, &f_swap, &res, &ierr);
-                    bCloseFile = TRUE;
-
-                    switch (ierr)
-                    {
-                        case MOPEN_NO_ERROR:
-                            fileDescriptor = fd;
-                            if (expandedFileName) {FREE(expandedFileName); expandedFileName = NULL;}
-                            break;
-                        case MOPEN_NO_MORE_LOGICAL_UNIT:
-                            {
-                                Scierror(66, _("%s: Too many files opened!\n"), fname);
-                                if (expandedFileName) {FREE(expandedFileName); expandedFileName = NULL;}
-                                return 0;
-                            }
-                            break;
-                        case MOPEN_CAN_NOT_OPEN_FILE:
-                            {
-                                Scierror(999, _("%s: Cannot open file %s.\n"), fname, expandedFileName);
-                                if (expandedFileName) {FREE(expandedFileName); expandedFileName = NULL;}
-                                return 0;
-                            }
-                            break;
-                        case MOPEN_NO_MORE_MEMORY:
-                            {
-                                if (expandedFileName) {FREE(expandedFileName); expandedFileName = NULL;}
-                                Scierror(999, _("%s: No more memory.\n"), fname);
-                                return 0;
-                            }
-                            break;
-                        case MOPEN_INVALID_FILENAME:
-                            {
-                                Scierror(999, _("%s: invalid filename %s.\n"), fname, expandedFileName);
-                                if (expandedFileName) {FREE(expandedFileName); expandedFileName = NULL;}
-                                return 0;
-                            }
-                            break;
-                        case MOPEN_INVALID_STATUS: default:
-                            {
-                                if (expandedFileName) {FREE(expandedFileName); expandedFileName = NULL;}
-                                Scierror(999, _("%s: invalid status.\n"), fname);
-                                return 0;
-                            }
-                            break;
-                    }
-                }
-            }
-            else
-            {
-                Scierror(999,_("%s: Memory allocation error.\n"), fname);
-                return 0;
-            }
-        }
-        else /* double */
-        {
-            double dValue = 0.;
-
-            if ( !getScalarDouble(_piKey, piAddressVarOne, &dValue) )
-            {
-                FILE *fd = NULL;
-                fileDescriptor = (int)dValue;
-                if ((fileDescriptor == STDIN_ID) || (fileDescriptor == STDOUT_ID))
-                {
-                    SciError(244);
-                    return 0;
-                }
-
-                fd = GetFileOpenedInScilab(fileDescriptor);
-                if (fd == NULL)
-                {
-                    Scierror(245,_("%s: No input file associated to logical unit %d.\n"), fname, fileDescriptor);
-                    return 0;
-                }
-            }
-            else
-            {
-                Scierror(999,_("%s: Memory allocation error.\n"), fname);
-                return 0;
-            }
-        }
-
-        wcReadedStrings = mgetl(fileDescriptor, numberOfLinesToRead, &numberOfLinesReaded, &iErrorMgetl);
-
-        if (bCloseFile)
-        {
-            double dErrClose = 0.;
-            C2F(mclose)(&fileDescriptor, &dErrClose);
-            bCloseFile = FALSE;
-        }
-
-        switch(iErrorMgetl)
-        {
-            case MGETL_NO_ERROR:
-            {
-                if (numberOfLinesReaded == 0)
-                {
-                    if (createEmptyMatrix(_piKey, Rhs + 1) != 0)
-                    {
-                        Scierror(999,_("%s: Memory allocation error.\n"), fname);
-                        return 0;
-                    }
-                }
-                else
-                {
-                    int m = numberOfLinesReaded;
-                    int n = 1;
-
-                    sciErr = createMatrixOfString(_piKey, Rhs + 1, m, n, wcReadedStrings);
-                    if(sciErr.iErr)
-                    {
-                        printError(&sciErr, 0);
-                        return 0;
-                    }
-                }
-
-                freeArrayOfString(wcReadedStrings, numberOfLinesReaded);
-                wcReadedStrings = NULL;
-            }
-            break;
-
-            case MGETL_EOF:
-            {
-                if (numberOfLinesReaded == 0)
-                {
-                    if (createEmptyMatrix(_piKey, Rhs + 1) != 0)
-                    {
-                        Scierror(999,_("%s: Memory allocation error.\n"), fname);
-                        return 0;
-                    }
-                }
-                else
-                {
-                    int m = numberOfLinesReaded;
-                    int n = 1;
-
-                    sciErr = createMatrixOfString(_piKey, Rhs + 1, m, n, wcReadedStrings);
-                    if(sciErr.iErr)
-                    {
-                        printError(&sciErr, 0);
-                        return 0;
-                    }
-                    freeArrayOfString(wcReadedStrings, numberOfLinesReaded);
-                    wcReadedStrings = NULL;
-                }
-            }
-            break;
-
-            case MGETL_MEMORY_ALLOCATION_ERROR:
-            {
-                if (wcReadedStrings)
-                {
-                    freeArrayOfString(wcReadedStrings, numberOfLinesReaded);
-                    wcReadedStrings = NULL;
-                }
-                Scierror(999,_("%s: Memory allocation error.\n"), fname);
-                return 0;
-            }
-            break;
-
-            case MGETL_ERROR:
-            {
-                if (wcReadedStrings)
-                {
-                    freeArrayOfString(wcReadedStrings, numberOfLinesReaded);
-                    wcReadedStrings = NULL;
-                }
-                Scierror(999,_("%s: error.\n"), fname);
-                return 0;
-            }
-            break;
-        }
-
-        LhsVar(1) = Rhs + 1;
-        C2F(putlhsvar)();
-    }
-    else
-    {
-        Scierror(999,_("%s: Wrong type for input argument #%d: String or logical unit expected.\n"), fname, 1);
-    }
-
-    return 0;
-}
-/*--------------------------------------------------------------------------*/
diff --git a/scilab/modules/fileio/sci_gateway/c/sci_mputl.c b/scilab/modules/fileio/sci_gateway/c/sci_mputl.c
deleted file mode 100644 (file)
index ad66de2..0000000
+++ /dev/null
@@ -1,262 +0,0 @@
-/*
-* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-* Copyright (C) 2010 - 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 "localization.h"
-#include "Scierror.h"
-#include "api_scilab.h"
-#include "mopen.h"
-#include "mclose.h"
-#include "expandPathVariable.h"
-#include "freeArrayOfString.h"
-#include "filesmanagement.h"
-#include "MALLOC.h"
-#include "BOOL.h"
-#include "mputl.h"
-/*--------------------------------------------------------------------------*/ 
-int sci_mputl(char *fname,  int* _piKey)
-{
-    SciErr sciErr;
-    int *piAddressVarOne = NULL;
-    int *piAddressVarTwo = NULL;
-
-    char **pStVarOne                   = NULL;
-    int *lenStVarOne                   = NULL;
-    int mOne = 0, nOne = 0;
-    int mnOne = 0;
-
-    char *filename = NULL;
-    int fileDescriptor = -1;
-    BOOL bCloseFile = FALSE;
-
-    int i = 0;
-    int mputlErr = MPUTL_ERROR;
-
-    if (Rhs != 2)
-    {
-        Scierror(999, _("Wrong number of input argument(s).\n"), fname, 2);
-        return 0;
-    }
-
-    if (Lhs != 1)
-    {
-        Scierror(999, _("Wrong number of output argument(s).\n"), fname, 1);
-        return 0;
-    }
-
-    sciErr = getVarAddressFromPosition(_piKey, 2, &piAddressVarTwo);
-    if(sciErr.iErr)
-    {
-        printError(&sciErr, 0);
-        return 0;
-    }
-
-    if ( isDoubleType(_piKey, piAddressVarTwo) )
-    {
-        double dValue = 0.;
-
-        if (!isScalar(_piKey, piAddressVarTwo))
-        {
-            Scierror(999,_("%s: Wrong size for input argument #%d: Integer expected.\n"), fname, 2);
-            return 0;
-        }
-
-        if ( getScalarDouble(_piKey, piAddressVarTwo, &dValue) == 0)
-        {
-            fileDescriptor = (int)dValue;
-        }
-        else
-        {
-            Scierror(999,_("%s: Memory allocation error.\n"), fname);
-            return 0;
-        }
-    } 
-    else if ( isStringType(_piKey, piAddressVarTwo) )
-    {
-        if (!isScalar(_piKey, piAddressVarTwo))
-        {
-            Scierror(999,_("%s: Wrong size for input argument #%d: String expected.\n"), fname, 2);
-            return 0;
-        }
-
-        if (getAllocatedSingleString(_piKey, piAddressVarTwo, &filename) == 0)
-        {
-            #define WRITE_ONLY_TEXT_MODE "wt"
-            int f_swap = 0;
-            double res = 0.0;
-            int ierr = 0;
-            char *expandedFileName = expandPathVariable(filename);
-            
-            C2F(mopen)(&fileDescriptor, expandedFileName, WRITE_ONLY_TEXT_MODE, &f_swap, &res, &ierr);
-            if (expandedFileName) {FREE(expandedFileName); expandedFileName = NULL;}
-
-            switch (ierr)
-            {
-            case MOPEN_NO_ERROR:
-                bCloseFile = TRUE;
-                break;
-            case MOPEN_NO_MORE_LOGICAL_UNIT:
-                {
-                    freeAllocatedSingleString(filename);
-                    Scierror(66, _("%s: Too many files opened!\n"), fname);
-                    return 0;
-                }
-                break;
-            case MOPEN_CAN_NOT_OPEN_FILE:
-                {
-                    Scierror(999, _("%s: Cannot open file %s.\n"), fname, filename);
-                    freeAllocatedSingleString(filename);
-                    return 0;
-                }
-                break;
-            case MOPEN_NO_MORE_MEMORY:
-                {
-                    freeAllocatedSingleString(filename);
-                    Scierror(999, _("%s: No more memory.\n"), fname);
-                    return 0;
-                }
-                break;
-            case MOPEN_INVALID_FILENAME:
-                {
-                    Scierror(999, _("%s: invalid filename %s.\n"), fname, filename);
-                    freeAllocatedSingleString(filename);
-                    return 0;
-                }
-                break;
-            case MOPEN_INVALID_STATUS: default:
-                {
-                    freeAllocatedSingleString(filename);
-                    Scierror(999, _("%s: invalid status.\n"), fname);
-                    return 0;
-                }
-                break;
-            }
-            bCloseFile = TRUE;
-            freeAllocatedSingleString(filename);
-        }
-        else
-        {
-            Scierror(999,_("%s: Memory allocation error.\n"), fname);
-            return 0;
-        }
-    }
-    else
-    {
-        Scierror(999,_("%s: Wrong type for input argument #%d: a String or Integer expected.\n"), fname, 2);
-    }
-
-    sciErr = getVarAddressFromPosition(_piKey, 1, &piAddressVarOne);
-    if(sciErr.iErr)
-    {
-        printError(&sciErr, 0);
-        return 0;
-    }
-
-    if (!isStringType(_piKey, piAddressVarOne))
-    {
-        Scierror(999,_("%s: Wrong type for input argument #%d: String expected.\n"), fname, 1);
-        return 0;
-    }
-
-    sciErr = getMatrixOfString(_piKey, piAddressVarOne,&mOne, &nOne, NULL, NULL);
-    if(sciErr.iErr)
-    {
-        printError(&sciErr, 0);
-        return 0;
-    }
-
-    if ( !((mOne == 1) || (nOne == 1)) )
-    {
-        Scierror(999,_("%s: Wrong size for input argument #%d: A 1-by-n or m-by-1 array expected.\n"), fname, 1);
-        return 0;
-    }
-
-    mnOne = mOne * nOne;
-
-    lenStVarOne = (int*)MALLOC(sizeof(int) * mnOne);
-    if (lenStVarOne == NULL)
-    {
-        Scierror(999, _("%s: No more memory.\n"), fname);
-        return 0;
-    }
-
-    sciErr = getMatrixOfString(_piKey, piAddressVarOne,&mOne, &nOne, lenStVarOne, NULL);
-    if(sciErr.iErr)
-    {
-        printError(&sciErr, 0);
-        return 0;
-    }
-
-    pStVarOne = (char**) MALLOC(sizeof(char*) * mnOne);
-    if (pStVarOne == NULL)
-    {
-        if (lenStVarOne) {FREE(lenStVarOne); lenStVarOne = NULL;}
-        Scierror(999, _("%s: No more memory.\n"), fname);
-        return 0;
-    }
-
-    for (i = 0; i < mnOne; i++)
-    {
-        pStVarOne[i] = (char*)MALLOC(sizeof(char) * (lenStVarOne[i] + 1));
-        if (pStVarOne[i] == NULL)
-        {
-            freeArrayOfString(pStVarOne, i);
-            if (lenStVarOne) {FREE(lenStVarOne); lenStVarOne = NULL;}
-            Scierror(999, _("%s: No more memory.\n"), fname);
-            return 0;
-        }
-    }
-
-    sciErr = getMatrixOfString(_piKey, piAddressVarOne, &mOne, &nOne, lenStVarOne, pStVarOne);
-    if (lenStVarOne) {FREE(lenStVarOne); lenStVarOne = NULL;}
-    if(sciErr.iErr)
-    {
-        freeArrayOfString(pStVarOne, mnOne);
-        printError(&sciErr, 0);
-        return 0;
-    }
-
-    mputlErr = mputl(fileDescriptor, pStVarOne, mnOne);
-    freeArrayOfString(pStVarOne, mnOne);
-
-    if (bCloseFile)
-    {
-        double dErrClose = 0.;
-        C2F(mclose)(&fileDescriptor, &dErrClose);
-        bCloseFile = FALSE;
-    }
-
-    switch (mputlErr)
-    {
-    case MPUTL_NO_ERROR:
-        createScalarBoolean(_piKey, Rhs + 1, TRUE);
-        LhsVar(1) = Rhs + 1;
-        PutLhsVar();
-        break;
-
-    case MPUTL_INVALID_FILE_DESCRIPTOR:
-        // commented for compatiblity
-        // Scierror(999, _("%s: invalid file descriptor.\n"), fname);
-        // break;
-    case MPUTL_ERROR:
-    case MPUTL_NO_WRITE_RIGHT:
-    default:
-        createScalarBoolean(_piKey, Rhs + 1, FALSE);
-        LhsVar(1) = Rhs + 1;
-        PutLhsVar();
-        break;
-    }
-
-    return 0;
-}
-/*--------------------------------------------------------------------------*/ 
index 98503e1..3575ff0 100644 (file)
@@ -29,5 +29,7 @@ bool FileioModule::Load()
     symbol::Context::getInstance()->AddFunction(Function::createFunction(L"mclose", &sci_mclose, MODULE_NAME));
     symbol::Context::getInstance()->AddFunction(Function::createFunction(L"mput", &sci_mput, MODULE_NAME));
     symbol::Context::getInstance()->AddFunction(Function::createFunction(L"mget", &sci_mget, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(Function::createFunction(L"mputl", &sci_mputl, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(Function::createFunction(L"mgetl", &sci_mgetl, MODULE_NAME));
     return true;
 }
index b052a54..c5a02ba 100644 (file)
@@ -44,7 +44,7 @@
                        <Tool
                                Name="VCCLCompilerTool"
                                Optimization="0"
-                               AdditionalIncludeDirectories="../../includes;../../../functions_manager/includes;../../../types/includes;../../../core/includes;../../../abstractSyntaxTree/includes;../../../symbol/includes;../../../api_scilab/includes;../../../operations/includes;../../../localization/includes;../../../output_stream/includes;../../../../libs/intl;../../../../libs/MALLOC/includes;../../../system_env/includes;../../../string/includes;../../../windows_tools/includes"
+                               AdditionalIncludeDirectories="../../includes;../../../functions_manager/includes;../../../types/includes;../../../core/includes;../../../abstractSyntaxTree/includes;../../../symbol/includes;../../../api_scilab/includes;../../../operations/includes;../../../localization/includes;../../../output_stream/includes;../../../../libs/intl;../../../../libs/MALLOC/includes;../../../system_env/includes;../../../string/includes;../../../windows_tools/includes;../../src/cpp"
                                PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;FILEIO_GW_EXPORTS"
                                MinimalRebuild="true"
                                BasicRuntimeChecks="3"
                        <Tool
                                Name="VCCLCompilerTool"
                                Optimization="0"
-                               AdditionalIncludeDirectories="../../includes;../../../functions_manager/includes;../../../types/includes;../../../core/includes;../../../abstractSyntaxTree/includes;../../../symbol/includes;../../../api_scilab/includes;../../../operations/includes;../../../localization/includes;../../../output_stream/includes;../../../../libs/intl;../../../../libs/MALLOC/includes;../../../system_env/includes;../../../string/includes;../../../windows_tools/includes"
+                               AdditionalIncludeDirectories="../../includes;../../../functions_manager/includes;../../../types/includes;../../../core/includes;../../../abstractSyntaxTree/includes;../../../symbol/includes;../../../api_scilab/includes;../../../operations/includes;../../../localization/includes;../../../output_stream/includes;../../../../libs/intl;../../../../libs/MALLOC/includes;../../../system_env/includes;../../../string/includes;../../../windows_tools/includes;../../src/cpp"
                                PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;FILEIO_GW_EXPORTS"
                                MinimalRebuild="true"
                                BasicRuntimeChecks="3"
                                Name="VCCLCompilerTool"
                                Optimization="2"
                                EnableIntrinsicFunctions="true"
-                               AdditionalIncludeDirectories="../../includes;../../../functions_manager/includes;../../../types/includes;../../../core/includes;../../../abstractSyntaxTree/includes;../../../symbol/includes;../../../api_scilab/includes;../../../operations/includes;../../../localization/includes;../../../output_stream/includes;../../../../libs/intl;../../../../libs/MALLOC/includes;../../../system_env/includes;../../../string/includes;../../../windows_tools/includes"
+                               AdditionalIncludeDirectories="../../includes;../../../functions_manager/includes;../../../types/includes;../../../core/includes;../../../abstractSyntaxTree/includes;../../../symbol/includes;../../../api_scilab/includes;../../../operations/includes;../../../localization/includes;../../../output_stream/includes;../../../../libs/intl;../../../../libs/MALLOC/includes;../../../system_env/includes;../../../string/includes;../../../windows_tools/includes;../../src/cpp"
                                PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;FILEIO_GW_EXPORTS"
                                RuntimeLibrary="2"
                                EnableFunctionLevelLinking="true"
                                Name="VCCLCompilerTool"
                                Optimization="2"
                                EnableIntrinsicFunctions="true"
-                               AdditionalIncludeDirectories="../../includes;../../../functions_manager/includes;../../../types/includes;../../../core/includes;../../../abstractSyntaxTree/includes;../../../symbol/includes;../../../api_scilab/includes;../../../operations/includes;../../../localization/includes;../../../output_stream/includes;../../../../libs/intl;../../../../libs/MALLOC/includes;../../../system_env/includes;../../../string/includes;../../../windows_tools/includes"
+                               AdditionalIncludeDirectories="../../includes;../../../functions_manager/includes;../../../types/includes;../../../core/includes;../../../abstractSyntaxTree/includes;../../../symbol/includes;../../../api_scilab/includes;../../../operations/includes;../../../localization/includes;../../../output_stream/includes;../../../../libs/intl;../../../../libs/MALLOC/includes;../../../system_env/includes;../../../string/includes;../../../windows_tools/includes;../../src/cpp"
                                PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;FILEIO_GW_EXPORTS"
                                RuntimeLibrary="2"
                                EnableFunctionLevelLinking="true"
                                >
                        </File>
                        <File
+                               RelativePath=".\sci_mgetl.cpp"
+                               >
+                       </File>
+                       <File
                                RelativePath=".\sci_mopen.cpp"
                                >
                        </File>
                                RelativePath=".\sci_mput.cpp"
                                >
                        </File>
+                       <File
+                               RelativePath=".\sci_mputl.cpp"
+                               >
+                       </File>
                </Filter>
                <Filter
                        Name="Header Files"
diff --git a/scilab/modules/fileio/sci_gateway/cpp/sci_mgetl.cpp b/scilab/modules/fileio/sci_gateway/cpp/sci_mgetl.cpp
new file mode 100644 (file)
index 0000000..e3b42e4
--- /dev/null
@@ -0,0 +1,385 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2006 - INRIA - Allan CORNET
+ * Copyright (C) 2010 - 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 "funcmanager.hxx"
+#include "filemanager.hxx"
+#include "fileio_gw.hxx"
+
+extern "C"
+{
+#include "mgetl.h"
+#include "localization.h"
+#include "Scierror.h"
+#include "mopen.h"
+#include "mclose.h"
+#include "expandPathVariable.h"
+}
+
+/*--------------------------------------------------------------------------*/
+Function::ReturnValue sci_mgetl(typed_list &in, int _iRetCount, typed_list &out)
+{
+    int iFileID         = 0;
+    int iErr            = 0;
+    bool bCloseFile     = false;
+    int iLinesExcepted  = -1;
+    int iLinesRead      = -1;
+
+    if(in.size() < 1 || in.size() > 2)
+    {
+        Scierror(999, _("%s: Wrong number of input arguments: %d to %d expected.\n"), "mgetl" , 1, 2);
+        return Function::OK;
+    }
+
+    if(in.size() == 2)
+    {//number of lines
+        if(in[1]->getType() != InternalType::RealDouble || in[1]->getAsDouble()->size_get() != 1)
+        {
+            Scierror(999,_("%s: Wrong type for input argument #%d: A scalar expected.\n"), "mgetl", 2);
+            return Function::Error;
+        }
+
+        iLinesExcepted = static_cast<int>(in[1]->getAsDouble()->real_get()[0]);
+    }
+
+    if(in[0]->getType() == InternalType::RealDouble && in[0]->getAsDouble()->size_get() == 1)
+    {
+        iFileID = static_cast<int>(in[0]->getAsDouble()->real_get()[0]);
+    }
+    else if(in[0]->getType() == InternalType::RealString && in[0]->getAsString()->size_get() == 1)
+    {
+        wchar_t *expandedFileName = expandPathVariableW(in[0]->getAsString()->string_get(0));
+
+        iErr = mopen(expandedFileName, L"rt", 0, &iFileID);
+        FREE(expandedFileName);
+
+        if(iErr)
+        {
+            switch(iErr)
+            {
+            case MOPEN_NO_MORE_LOGICAL_UNIT:
+                ScierrorW(66, _W("%ls: Too many files opened!\n"), L"mputl");
+                break;
+            case MOPEN_CAN_NOT_OPEN_FILE:
+                ScierrorW(999, _W("%ls: Cannot open file %ls.\n"), L"mputl", expandedFileName);
+                break;
+            case MOPEN_NO_MORE_MEMORY:
+                ScierrorW(999, _W("%ls: No more memory.\n"), L"mputl");
+                break;
+            case MOPEN_INVALID_FILENAME:
+                ScierrorW(999, _W("%ls: invalid filename %ls.\n"), L"mputl", expandedFileName);
+                break;
+            default: //MOPEN_INVALID_STATUS
+                ScierrorW(999, _W("%ls: invalid status.\n"), L"mputl");
+                break;
+            }
+            return Function::Error;
+        }
+        bCloseFile = true;
+    }
+    else
+    {//Error
+        Scierror(999,_("%s: Wrong type for input argument #%d: a String or Integer expected.\n"), "mgetl", 1);
+        return Function::Error;
+    }
+
+    wchar_t** wcReadedStrings = mgetl(iFileID, iLinesExcepted, &iLinesRead, &iErr);
+
+    switch(iErr)
+    {
+    case MGETL_MEMORY_ALLOCATION_ERROR : 
+        break;
+
+    }
+    String *pS = new String(iLinesRead, 1);
+    pS->string_set(wcReadedStrings);
+    out.push_back(pS);
+
+    if(bCloseFile)
+    {
+        mclose(iFileID);
+    }
+
+    return Function::OK;
+    //SciErr sciErr;
+    //int *piAddressVarOne = NULL;
+
+    //Rhs = Max(0, Rhs);
+
+    //CheckRhs(1, 2);
+    //CheckLhs(1, 1);
+
+    //if (Rhs == 2)
+    //{
+    //    int *piAddressVarTwo = NULL;
+
+    //    sciErr = getVarAddressFromPosition(_piKey, 2, &piAddressVarTwo);
+    //    if(sciErr.iErr)
+    //    {
+    //        printError(&sciErr, 0);
+    //        return 0;
+    //    }
+
+    //    if ( isDoubleType(_piKey, piAddressVarTwo) )
+    //    {
+    //        double dValue = 0.;
+    //        if (!isScalar(_piKey, piAddressVarTwo))
+    //        {
+    //            Scierror(999,_("%s: Wrong size for input argument #%d: Integer expected.\n"), fname, 2);
+    //            return 0;
+    //        }
+
+    //        if ( getScalarDouble(_piKey, piAddressVarTwo, &dValue) == 0)
+    //        {
+    //            numberOfLinesToRead = (int)dValue;
+    //        }
+    //        else
+    //        {
+    //            Scierror(999,_("%s: Memory allocation error.\n"), fname);
+    //            return 0;
+    //        }
+    //    }
+    //    else
+    //    {
+    //        Scierror(999,_("%s: Wrong type for input argument #%d: Integer expected.\n"), fname, 2);
+    //        return 0;
+    //    }
+    //}
+
+    //sciErr = getVarAddressFromPosition(_piKey, 1, &piAddressVarOne);
+    //if(sciErr.iErr)
+    //{
+    //    printError(&sciErr, 0);
+    //    return 0;
+    //}
+
+    //if ( isStringType(_piKey, piAddressVarOne) || isDoubleType(_piKey, piAddressVarOne) )
+    //{
+    //    char **wcReadedStrings = NULL;
+    //    int numberOfLinesReaded = 0;
+    //    int fileDescriptor = -1;
+    //    int iErrorMgetl = 0;
+    //    BOOL bCloseFile = FALSE;
+
+    //    if (!isScalar(_piKey, piAddressVarOne))
+    //    {
+    //        Scierror(999,_("%s: Wrong size for input argument #%d: String or logical unit expected.\n"), fname, 1);
+    //        return 0;
+    //    }
+
+    //    if (isStringType(_piKey, piAddressVarOne))
+    //    {
+    //        char *fileName = NULL;
+    //        if (getAllocatedSingleString(_piKey, piAddressVarOne, &fileName) == 0)
+    //        {
+    //            char *expandedFileName = expandPathVariable(fileName);
+    //            freeAllocatedSingleString(fileName);
+    //            fileName = NULL;
+
+    //            if (IsAlreadyOpenedInScilab(expandedFileName))
+    //            {
+    //                int fd = GetIdFromFilename(expandedFileName);
+    //                fileDescriptor = fd;
+    //                if (expandedFileName) {FREE(expandedFileName); expandedFileName = NULL;}
+    //                bCloseFile = FALSE;
+    //            }
+    //            else
+    //            {
+    //                #define READ_ONLY_TEXT_MODE "rt"
+    //                int fd = 0;
+    //                int f_swap = 0;
+    //                double res = 0.0;
+    //                int ierr = 0;
+
+    //                C2F(mopen)(&fd, expandedFileName, READ_ONLY_TEXT_MODE, &f_swap, &res, &ierr);
+    //                bCloseFile = TRUE;
+
+    //                switch (ierr)
+    //                {
+    //                    case MOPEN_NO_ERROR:
+    //                        fileDescriptor = fd;
+    //                        if (expandedFileName) {FREE(expandedFileName); expandedFileName = NULL;}
+    //                        break;
+    //                    case MOPEN_NO_MORE_LOGICAL_UNIT:
+    //                        {
+    //                            Scierror(66, _("%s: Too many files opened!\n"), fname);
+    //                            if (expandedFileName) {FREE(expandedFileName); expandedFileName = NULL;}
+    //                            return 0;
+    //                        }
+    //                        break;
+    //                    case MOPEN_CAN_NOT_OPEN_FILE:
+    //                        {
+    //                            Scierror(999, _("%s: Cannot open file %s.\n"), fname, expandedFileName);
+    //                            if (expandedFileName) {FREE(expandedFileName); expandedFileName = NULL;}
+    //                            return 0;
+    //                        }
+    //                        break;
+    //                    case MOPEN_NO_MORE_MEMORY:
+    //                        {
+    //                            if (expandedFileName) {FREE(expandedFileName); expandedFileName = NULL;}
+    //                            Scierror(999, _("%s: No more memory.\n"), fname);
+    //                            return 0;
+    //                        }
+    //                        break;
+    //                    case MOPEN_INVALID_FILENAME:
+    //                        {
+    //                            Scierror(999, _("%s: invalid filename %s.\n"), fname, expandedFileName);
+    //                            if (expandedFileName) {FREE(expandedFileName); expandedFileName = NULL;}
+    //                            return 0;
+    //                        }
+    //                        break;
+    //                    case MOPEN_INVALID_STATUS: default:
+    //                        {
+    //                            if (expandedFileName) {FREE(expandedFileName); expandedFileName = NULL;}
+    //                            Scierror(999, _("%s: invalid status.\n"), fname);
+    //                            return 0;
+    //                        }
+    //                        break;
+    //                }
+    //            }
+    //        }
+    //        else
+    //        {
+    //            Scierror(999,_("%s: Memory allocation error.\n"), fname);
+    //            return 0;
+    //        }
+    //    }
+    //    else /* double */
+    //    {
+    //        double dValue = 0.;
+
+    //        if ( !getScalarDouble(_piKey, piAddressVarOne, &dValue) )
+    //        {
+    //            FILE *fd = NULL;
+    //            fileDescriptor = (int)dValue;
+    //            if ((fileDescriptor == STDIN_ID) || (fileDescriptor == STDOUT_ID))
+    //            {
+    //                SciError(244);
+    //                return 0;
+    //            }
+
+    //            fd = GetFileOpenedInScilab(fileDescriptor);
+    //            if (fd == NULL)
+    //            {
+    //                Scierror(245,_("%s: No input file associated to logical unit %d.\n"), fname, fileDescriptor);
+    //                return 0;
+    //            }
+    //        }
+    //        else
+    //        {
+    //            Scierror(999,_("%s: Memory allocation error.\n"), fname);
+    //            return 0;
+    //        }
+    //    }
+
+    //    wcReadedStrings = mgetl(fileDescriptor, numberOfLinesToRead, &numberOfLinesReaded, &iErrorMgetl);
+
+    //    if (bCloseFile)
+    //    {
+    //        double dErrClose = 0.;
+    //        C2F(mclose)(&fileDescriptor, &dErrClose);
+    //        bCloseFile = FALSE;
+    //    }
+
+    //    switch(iErrorMgetl)
+    //    {
+    //        case MGETL_NO_ERROR:
+    //        {
+    //            if (numberOfLinesReaded == 0)
+    //            {
+    //                if (createEmptyMatrix(_piKey, Rhs + 1) != 0)
+    //                {
+    //                    Scierror(999,_("%s: Memory allocation error.\n"), fname);
+    //                    return 0;
+    //                }
+    //            }
+    //            else
+    //            {
+    //                int m = numberOfLinesReaded;
+    //                int n = 1;
+
+    //                sciErr = createMatrixOfString(_piKey, Rhs + 1, m, n, wcReadedStrings);
+    //                if(sciErr.iErr)
+    //                {
+    //                    printError(&sciErr, 0);
+    //                    return 0;
+    //                }
+    //            }
+
+    //            freeArrayOfString(wcReadedStrings, numberOfLinesReaded);
+    //            wcReadedStrings = NULL;
+    //        }
+    //        break;
+
+    //        case MGETL_EOF:
+    //        {
+    //            if (numberOfLinesReaded == 0)
+    //            {
+    //                if (createEmptyMatrix(_piKey, Rhs + 1) != 0)
+    //                {
+    //                    Scierror(999,_("%s: Memory allocation error.\n"), fname);
+    //                    return 0;
+    //                }
+    //            }
+    //            else
+    //            {
+    //                int m = numberOfLinesReaded;
+    //                int n = 1;
+
+    //                sciErr = createMatrixOfString(_piKey, Rhs + 1, m, n, wcReadedStrings);
+    //                if(sciErr.iErr)
+    //                {
+    //                    printError(&sciErr, 0);
+    //                    return 0;
+    //                }
+    //                freeArrayOfString(wcReadedStrings, numberOfLinesReaded);
+    //                wcReadedStrings = NULL;
+    //            }
+    //        }
+    //        break;
+
+    //        case MGETL_MEMORY_ALLOCATION_ERROR:
+    //        {
+    //            if (wcReadedStrings)
+    //            {
+    //                freeArrayOfString(wcReadedStrings, numberOfLinesReaded);
+    //                wcReadedStrings = NULL;
+    //            }
+    //            Scierror(999,_("%s: Memory allocation error.\n"), fname);
+    //            return 0;
+    //        }
+    //        break;
+
+    //        case MGETL_ERROR:
+    //        {
+    //            if (wcReadedStrings)
+    //            {
+    //                freeArrayOfString(wcReadedStrings, numberOfLinesReaded);
+    //                wcReadedStrings = NULL;
+    //            }
+    //            Scierror(999,_("%s: error.\n"), fname);
+    //            return 0;
+    //        }
+    //        break;
+    //    }
+
+    //    LhsVar(1) = Rhs + 1;
+    //    C2F(putlhsvar)();
+    //}
+    //else
+    //{
+    //    Scierror(999,_("%s: Wrong type for input argument #%d: String or logical unit expected.\n"), fname, 1);
+    //}
+
+    //return 0;
+}
+/*--------------------------------------------------------------------------*/
index 90ea163..c5208f7 100644 (file)
@@ -106,6 +106,7 @@ Function::ReturnValue sci_mopen(typed_list &in, int _iRetCount, typed_list &out)
     }
 
 
+       std::wcout << L"mode : " << pstMode << std::endl;
     iErr = mopen(pstFilename, pstMode, iSwap, &iID);
 
 
diff --git a/scilab/modules/fileio/sci_gateway/cpp/sci_mputl.cpp b/scilab/modules/fileio/sci_gateway/cpp/sci_mputl.cpp
new file mode 100644 (file)
index 0000000..c5eb62b
--- /dev/null
@@ -0,0 +1,140 @@
+/*
+* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+* Copyright (C) 2010 - 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 "funcmanager.hxx"
+#include "filemanager.hxx"
+#include "fileio_gw.hxx"
+
+extern "C"
+{
+#include "mputl.h"
+#include "localization.h"
+#include "Scierror.h"
+#include "mopen.h"
+#include "mclose.h"
+#include "expandPathVariable.h"
+}
+/*--------------------------------------------------------------------------*/ 
+Function::ReturnValue sci_mputl(typed_list &in, int _iRetCount, typed_list &out)
+{
+    int iFileID     = 0;
+    int iErr        = 0;
+    bool bCloseFile = false;
+
+    if(in.size() != 2)
+    {
+        Scierror(77,_("%s: Wrong number of input argument(s): %d expected.\n"),"mputl", 2);
+        return Function::Error;
+    }
+
+    if(_iRetCount != 1)
+    {
+        Scierror(78,_("%s: Wrong number of output argument(s): %d expected.\n"), "mputl", 1);
+        return Function::Error;
+    }
+
+    if(in[1]->getType() == InternalType::RealDouble && in[1]->getAsDouble()->size_get() == 1)
+    {
+        iFileID = static_cast<int>(in[1]->getAsDouble()->real_get()[0]);
+    }
+    else if(in[1]->getType() == InternalType::RealString && in[1]->getAsString()->size_get() == 1)
+    {
+        wchar_t *expandedFileName = expandPathVariableW(in[1]->getAsString()->string_get(0));
+
+        iErr = mopen(expandedFileName, L"wb", 0, &iFileID);
+        FREE(expandedFileName);
+
+        if(iErr)
+        {
+            switch(iErr)
+            {
+            case MOPEN_NO_MORE_LOGICAL_UNIT:
+                ScierrorW(66, _W("%ls: Too many files opened!\n"), L"mputl");
+                break;
+            case MOPEN_CAN_NOT_OPEN_FILE:
+                ScierrorW(999, _W("%ls: Cannot open file %ls.\n"), L"mputl", expandedFileName);
+                break;
+            case MOPEN_NO_MORE_MEMORY:
+                ScierrorW(999, _W("%ls: No more memory.\n"), L"mputl");
+                break;
+            case MOPEN_INVALID_FILENAME:
+                ScierrorW(999, _W("%ls: invalid filename %ls.\n"), L"mputl", expandedFileName);
+                break;
+            default: //MOPEN_INVALID_STATUS
+                ScierrorW(999, _W("%ls: invalid status.\n"), L"mputl");
+                break;
+            }
+            return Function::Error;
+        }
+        bCloseFile = true;
+    }
+    else
+    {//Error
+        Scierror(999,_("%s: Wrong type for input argument #%d: a String or Integer expected.\n"), "mputl", 2);
+        return Function::Error;
+    }
+
+    //String vextor, row or col
+    if(in[0]->getType() != InternalType::RealString || (in[0]->getAsString()->rows_get() != 1 && in[0]->getAsString()->cols_get() != 1))
+    {
+        Scierror(999,_("%s: Wrong size for input argument #%d: A 1-by-n or m-by-1 array expected.\n"), "mputl", 1);
+        return Function::Error;
+    }
+
+    String* pS = in[0]->getAsString();
+
+    iErr = mputl(iFileID, pS->string_get(), pS->size_get());
+
+    out.push_back(new Bool(!iErr));
+
+    if(bCloseFile)
+    {
+        mclose(iFileID);
+    }
+
+    return Function::OK;
+
+
+    //mputlErr = mputl(fileDescriptor, pStVarOne, mnOne);
+    //freeArrayOfString(pStVarOne, mnOne);
+
+    //if (bCloseFile)
+    //{
+    //    double dErrClose = 0.;
+    //    C2F(mclose)(&fileDescriptor, &dErrClose);
+    //    bCloseFile = FALSE;
+    //}
+
+    //switch (mputlErr)
+    //{
+    //case MPUTL_NO_ERROR:
+    //    createScalarBoolean(pvApiCtx, Rhs + 1, TRUE);
+    //    LhsVar(1) = Rhs + 1;
+    //    PutLhsVar();
+    //    break;
+
+    //case MPUTL_INVALID_FILE_DESCRIPTOR:
+    //    // commented for compatiblity
+    //    // Scierror(999, _("%s: invalid file descriptor.\n"), fname);
+    //    // break;
+    //case MPUTL_ERROR:
+    //case MPUTL_NO_WRITE_RIGHT:
+    //default:
+    //    createScalarBoolean(pvApiCtx, Rhs + 1, FALSE);
+    //    LhsVar(1) = Rhs + 1;
+    //    PutLhsVar();
+    //    break;
+    //}
+
+    //return 0;
+}
+/*--------------------------------------------------------------------------*/ 
index a7d4074..47aade6 100644 (file)
@@ -24,6 +24,7 @@
 #include "localization.h"
 #include "sciprint.h"
 #include "os_strdup.h"
+#include "os_wcsdup.h"
 #include "charEncoding.h"
 /*--------------------------------------------------------------------------*/
 #ifndef _MSC_VER
@@ -66,7 +67,7 @@ wchar_t** findfilesW(wchar_t *path, wchar_t *filespec, int *sizeListReturned, BO
                 {
                     ListFiles = (wchar_t**)MALLOC(sizeof(wchar_t*)*(nbElements));
                 }
-                               ListFiles[nbElements-1] = wcsdup(FileInformation.cFileName);
+                               ListFiles[nbElements-1] = os_wcsdup(FileInformation.cFileName);
                        }
                } while(FindNextFileW(hFile, &FileInformation) == TRUE);
        }
index b6f857d..085ae20 100644 (file)
@@ -26,6 +26,7 @@
 #include "MALLOC.h"
 #include "charEncoding.h"
 #include "os_strdup.h"
+#include "os_wcsdup.h"
 /*--------------------------------------------------------------------------*/
 BOOL isdir(const char * path)
 {
@@ -57,7 +58,7 @@ BOOL isdirW(const wchar_t * wcpath)
        else
        {
                DWORD attr = 0;
-               wchar_t *tmpPath = wcsdup(wcpath);
+               wchar_t *tmpPath = os_wcsdup(wcpath);
 
                if ( (tmpPath[wcslen(tmpPath) - 1] == L'\\') || (tmpPath[wcslen(tmpPath) - 1] == L'/') )
                {
diff --git a/scilab/modules/fileio/src/c/mputl.c b/scilab/modules/fileio/src/c/mputl.c
deleted file mode 100644 (file)
index e92d89c..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
-* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-* Copyright (C) 2010 - 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 <string.h>
-#include <stdio.h>
-#include "mputl.h"
-#include "filesmanagement.h"
-#include "sciprint.h"
-/*--------------------------------------------------------------------------*/
-#define MPUTL_FORMAT "%s\n"
-/*--------------------------------------------------------------------------*/
-mputlError mputl(int fileDescriptor, char **pStrings, int sizeStrings)
-{
-    FILE *fw = NULL;
-    int i = 0;
-
-    if (pStrings == NULL) return MPUTL_ERROR;
-
-    if (fileDescriptor == STDIN_ID)
-    {
-        return MPUTL_INVALID_FILE_DESCRIPTOR;
-    }
-    else if (fileDescriptor == STDOUT_ID) 
-    {
-        fw = stdout;
-    }
-    else
-    {
-        fw = GetFileOpenedInScilab(fileDescriptor);
-        if (fw)
-        {
-            int mode = GetFileModeOpenedInScilab(fileDescriptor);
-
-            if ( (mode >= 100) && (mode < 200) )
-            {
-                return MPUTL_NO_WRITE_RIGHT;
-            }
-        }
-        else
-        {
-            return MPUTL_INVALID_FILE_DESCRIPTOR;
-        }
-    }
-
-    for (i = 0; i < sizeStrings; i++)
-    {
-        if (fw == stdout)
-        {
-            sciprint(MPUTL_FORMAT, pStrings[i]);
-        }
-        else
-        {
-            fprintf(fw, MPUTL_FORMAT, pStrings[i]);
-        }
-    }
-
-    return MPUTL_NO_ERROR;
-}
-/*--------------------------------------------------------------------------*/ 
-
index 2879429..29bf468 100644 (file)
@@ -12,6 +12,7 @@
 
 #include "filemanager.hxx"
 #include "os_wcsdup.h"
+#include <stdio.h>
 
 std::vector<types::File*> FileManager::m_fileList;
 int FileManager::m_iCurrentFile = -1;
@@ -20,7 +21,7 @@ int FileManager::getFileID(wstring _stFilename)
 {
     for(int i = 0 ; i < m_fileList.size() ; i++)
     {
-        if(m_fileList[i]->getFilename() == _stFilename)
+        if(m_fileList[i] != NULL && m_fileList[i]->getFilename() == _stFilename)
         {
             return i + 1;
         }
@@ -37,7 +38,7 @@ bool FileManager::isOpened(wstring _stFilename)
 {
     for(int i = 0 ; i < m_fileList.size() ; i++)
     {
-        if(m_fileList[i]->getFilename() == _stFilename)
+        if(m_fileList[i] != NULL && m_fileList[i]->getFilename() == _stFilename)
         {
             return true;
         }
@@ -212,3 +213,31 @@ double* FileManager::getSwaps()
     return pdblSwaps;
 }
 
+void FileManager::initialize()
+{
+    File* pIn = new File();
+    pIn->setFileMode(L"rb");
+    pIn->setFileDesc(stdin);
+    pIn->setFileSwap(0);
+    pIn->setFileType(1);
+    pIn->setFilename(L"stdin");
+
+    File* pOut = new File();
+    pOut->setFileMode(L"wb");
+    pOut->setFileDesc(stdout);
+    pOut->setFileSwap(0);
+    pOut->setFileType(1);
+    pOut->setFilename(L"stdout");
+
+    //insert free space
+    m_fileList.push_back(NULL);
+    m_fileList.push_back(NULL);
+    m_fileList.push_back(NULL);
+    m_fileList.push_back(NULL);
+
+    //put pIn at position 5
+    m_fileList.push_back(pIn);
+    //put pOut at position 6
+    m_fileList.push_back(pOut);
+}
+
similarity index 73%
rename from scilab/modules/fileio/src/c/mgetl.c
rename to scilab/modules/fileio/src/cpp/mgetl.cpp
index 2afaeb6..c7bb9f4 100644 (file)
@@ -1,6 +1,7 @@
 /*
 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
 * Copyright (C) 2010 - DIGITEO - Allan CORNET
+* Copyright (C) 2010 - DIGITEO - Antoine ELIAS
 * 
 * This file must be used under the terms of the CeCILL.
 * This source file is licensed as described in the file COPYING, which
 */
 /*--------------------------------------------------------------------------*/
 #include <string.h>
+#include "filemanager.hxx"
+
+extern "C"
+{
 #include "mgetl.h"
 #include "filesmanagement.h"
 #include "mopen.h"
 #include "MALLOC.h"
-#include "BOOL.h"
+#include "os_wcsdup.h"
 #include "os_strdup.h"
-#include "charEncoding.h"
+}
 /*--------------------------------------------------------------------------*/
 #define LINE_MAX 4096
-#define CR '\r'
-#define LF '\n'
+#define CR L'\r'
+#define LF L'\n'
+#define EMPTYSTRW L""
 #define EMPTYSTR ""
 /*--------------------------------------------------------------------------*/
-static char *removeEOL(char *_inString);
+static wchar_t *removeEOL(wchar_t *_inString);
 static char *convertAnsiToUtf(char *_inString);
+static wchar_t* getLine(wchar_t* _pstLine, int _iLineSize, File* _pFile);
 /*--------------------------------------------------------------------------*/
-char **mgetl(int fd, int nbLinesIn, int *nbLinesOut, int *ierr)
+wchar_t **mgetl(int fd, int nbLinesIn, int *nbLinesOut, int *ierr)
 {
-    char **strLines = NULL;
-    FILE *fa = NULL;
+    wchar_t **strLines = NULL;
+    File* pFile     = NULL;
 
     *ierr = MGETL_ERROR;
     *nbLinesOut = 0;
 
-    if (fd == STDIN_ID) 
-    {
-        fa = stdin;
-    }
-    else
-    {
-        fa = GetFileOpenedInScilab(fd);
-    }
+    pFile = FileManager::getFile(fd);
 
-    if (fa)
+    if (pFile)
     {
-        char Line[LINE_MAX * 2];
+        wchar_t Line[LINE_MAX * 2];
         int nbLines = 0;
 
         if (nbLinesIn < 0)
         {
-            strLines = (char **)MALLOC(sizeof(char *));
+            strLines = (wchar_t **)MALLOC(sizeof(wchar_t *));
             if (strLines == NULL)
             {
                 *nbLinesOut = 0;
@@ -59,10 +59,10 @@ char **mgetl(int fd, int nbLinesIn, int *nbLinesOut, int *ierr)
                 return NULL;
             }
 
-            while ( fgets ( Line, sizeof(Line), fa ) != NULL )
+            while ( getLine ( Line, sizeof(Line), pFile ) != NULL )
             {
                 nbLines++;
-                strLines = (char **)REALLOC(strLines, nbLines * sizeof(char *));
+                strLines = (wchar_t **)REALLOC(strLines, nbLines * sizeof(wchar_t *));
                 if (strLines == NULL)
                 {
                     *nbLinesOut = 0;
@@ -70,14 +70,14 @@ char **mgetl(int fd, int nbLinesIn, int *nbLinesOut, int *ierr)
                     return NULL;
                 }
 
-                strLines[nbLines - 1] = convertAnsiToUtf(removeEOL(Line)); 
+                strLines[nbLines - 1] = os_wcsdup(removeEOL(Line)); 
                 if (strLines[nbLines - 1] == NULL)
                 {
                     *nbLinesOut = 0;
                     *ierr = MGETL_MEMORY_ALLOCATION_ERROR;
                     return NULL;
                 }
-                strcpy(Line, EMPTYSTR);
+                wcscpy(Line, EMPTYSTRW);
             }
             *nbLinesOut = nbLines;
             *ierr = MGETL_NO_ERROR;
@@ -98,7 +98,7 @@ char **mgetl(int fd, int nbLinesIn, int *nbLinesOut, int *ierr)
             {
                 BOOL bContinue = TRUE;
                 BOOL bEOF = FALSE;
-                strLines = (char **)MALLOC(sizeof(char *) * nbLinesIn);
+                strLines = (wchar_t **)MALLOC(sizeof(wchar_t *) * nbLinesIn);
                 if (strLines == NULL)
                 {
                     *nbLinesOut = 0;
@@ -110,22 +110,22 @@ char **mgetl(int fd, int nbLinesIn, int *nbLinesOut, int *ierr)
                 {
                     if (nbLines < nbLinesIn)
                     {
-                        if ( fgets ( Line, sizeof(Line), fa ) != NULL)
+                        if ( getLine ( Line, sizeof(Line), pFile) != NULL)
                         {
                             nbLines++;
-                            strLines[nbLines - 1] = convertAnsiToUtf(removeEOL(Line)); 
+                            strLines[nbLines - 1] = os_wcsdup(removeEOL(Line));
                             if (strLines[nbLines - 1] == NULL)
                             {
                                 *nbLinesOut = 0;
                                 *ierr = MGETL_MEMORY_ALLOCATION_ERROR;
                                 return NULL;
                             }
-                            strcpy(Line, EMPTYSTR);
+                            wcscpy(Line, EMPTYSTRW);
                         }
                         else
                         {
                             /* EOF */
-                            if (feof(fa))
+                            if (feof(pFile->getFiledesc()))
                             {
                                 bEOF = TRUE;
                             }
@@ -153,18 +153,42 @@ char **mgetl(int fd, int nbLinesIn, int *nbLinesOut, int *ierr)
     return strLines;
 }
 /*--------------------------------------------------------------------------*/
-char *removeEOL(char *_inString)
+wchar_t* getLine(wchar_t* _pstLine, int _iLineSize, File* _pFile)
+{
+    if(static_cast<int>(_pFile->getFileModeAsDouble()) % 2 == 1)
+    {//binary mode
+        return fgetws(_pstLine, _iLineSize, _pFile->getFiledesc());
+    }
+    else
+    {
+        char* pstTemp = (char*)MALLOC(sizeof(char*) * _iLineSize);
+        if(fgets(pstTemp, _iLineSize, _pFile->getFiledesc()) == NULL)
+        {
+            FREE(pstTemp);
+            return NULL;
+        }
+        char* pstUtf = convertAnsiToUtf(pstTemp);
+        wchar_t* pstTempWide = to_wide_string(pstUtf);
+        wcscpy(_pstLine, pstTempWide);
+        FREE(pstUtf);
+        FREE(pstTemp);
+        FREE(pstTempWide);
+        return _pstLine;
+    }
+}
+/*--------------------------------------------------------------------------*/
+wchar_t *removeEOL(wchar_t *_inString)
 {
     if (_inString)
     {
-        char *pos = strchr(_inString, LF);
-        if (pos)
+        wchar_t *pos = wcschr(_inString, LF);
+        if(pos)
         {
             *pos = 0;
         }
 
-        pos = strchr(_inString, CR);
-        if (pos)
+        pos = wcschr(_inString, CR);
+        if(pos)
         {
             *pos = 0;
         }
@@ -198,7 +222,7 @@ char *convertAnsiToUtf(char *_inString)
             {
                 MultiByteToWideChar(CP_ACP, 0, _inString, lstrlen(_inString), bstrCode, Len);   
                 newLen = WideCharToMultiByte(CP_UTF8, 0, bstrCode, -1, outString, 0, NULL, NULL);    
-                outString = (char*) MALLOC(newLen + 1);    
+                outString = (char*) MALLOC(sizeof(char) * (newLen + 1));
                 if (outString)
                 {
                     WideCharToMultiByte(CP_UTF8, 0, bstrCode, -1, outString, newLen, NULL, NULL); 
@@ -209,7 +233,6 @@ char *convertAnsiToUtf(char *_inString)
                 }
                 SysFreeString(bstrCode);
                 bstrCode = NULL;
-
             }
             else
             {
@@ -227,16 +250,26 @@ char *convertAnsiToUtf(char *_inString)
             int i = 0;
 
             outString = (char*)MALLOC(((len*3) + 1) * sizeof(char));
-            if (outString == NULL) return NULL;
+            if (outString == NULL)
+            {
+                return NULL;
+            }
+
             strcpy(outString, EMPTYSTR);
 
             for (i = 0; i < len; i++)
             {
-                unsigned char *outUtfChar = NULL;
+                char *outUtfChar = NULL;
                 unsigned char inAnsiChar = 0;
 
-                if (_inString[i] < 0) inAnsiChar = 256 + _inString[i];
-                else inAnsiChar = _inString[i];
+                if (_inString[i] < 0)
+               {
+                        inAnsiChar = 256 + _inString[i];
+               }
+                else
+               {
+                        inAnsiChar = _inString[i];
+               }
 
                 if(inAnsiChar < 128)
                 {
similarity index 94%
rename from scilab/modules/fileio/src/c/mgetl.h
rename to scilab/modules/fileio/src/cpp/mgetl.h
index eddc19a..299a0c6 100644 (file)
@@ -12,7 +12,6 @@
 /*--------------------------------------------------------------------------*/
 #ifndef __MGETL_H__
 #define __MGETL_H__
-
 #include "dynlib_fileio.h"
 #include "charEncoding.h"
 
@@ -43,7 +42,8 @@ typedef enum {
  *
  * @return  null if it fails, else strings readed. 
 **/
-FILEIO_IMPEXP char ** mgetl(int fd, int nbLinesIn, int *nbLinesOut, int *ierr);
+FILEIO_IMPEXP wchar_t** mgetl(int fd, int nbLinesIn, int *nbLinesOut, int *ierr);
+
 
 #endif /* __MGETL_H__ */
 /*--------------------------------------------------------------------------*/
diff --git a/scilab/modules/fileio/src/cpp/mputl.cpp b/scilab/modules/fileio/src/cpp/mputl.cpp
new file mode 100644 (file)
index 0000000..3265680
--- /dev/null
@@ -0,0 +1,96 @@
+/*
+* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+* Copyright (C) 2010 - 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 <string.h>
+#include <stdio.h>
+#include "filemanager.hxx"
+#include "sciprint.h"
+#include <fcntl.h>
+
+extern "C"
+{
+#include "mputl.h"
+#include "charEncoding.h"
+}
+/*--------------------------------------------------------------------------*/
+#define MPUTL_FORMAT "%s\n"
+/*--------------------------------------------------------------------------*/
+mputlError mputl(int _iFileId, wchar_t **pstStrings, int _iSizeStrings)
+{
+    int i = 0;
+    File* pF = NULL;
+
+    if(pstStrings == NULL)
+    {
+        return MPUTL_ERROR;
+    }
+
+    if(_iFileId == STDIN_ID)
+    {
+        return MPUTL_INVALID_FILE_DESCRIPTOR;
+    }
+    else
+    {
+        pF = FileManager::getFile(_iFileId);
+        if(pF)
+        {
+            if(pF->getFileModeAsDouble() >= 100 && pF->getFileModeAsDouble() < 200)
+            {
+                return MPUTL_NO_WRITE_RIGHT;
+            }
+        }
+        else
+        {
+            return MPUTL_INVALID_FILE_DESCRIPTOR;
+        }
+    }
+
+
+    //export in UTF-8 if file is not open in binary mode
+    if(static_cast<int>(pF->getFileModeAsDouble()) % 2 == 1)
+    {//binary mode
+        for (i = 0; i < _iSizeStrings; i++)
+        {
+            if(fputws(pstStrings[i], pF->getFiledesc()) == -1)
+            {
+                return MPUTL_ERROR;
+            }
+
+            if(fputws(L"\n", pF->getFiledesc()) == -1)
+            {
+                return MPUTL_ERROR;
+            }
+        }
+    }
+    else
+    {//text mode
+        for (i = 0; i < _iSizeStrings; i++)
+        {
+            char* pstTemp = wide_string_to_UTF8(pstStrings[i]);
+            int iRet = fputs(pstTemp, pF->getFiledesc());
+            FREE(pstTemp);
+            if(iRet == -1)
+            {
+                return MPUTL_ERROR;
+            }
+
+            iRet = fputs("\n", pF->getFiledesc());
+            if(iRet == -1)
+            {
+                return MPUTL_ERROR;
+            }
+        }
+    }
+    return MPUTL_NO_ERROR;
+}
+/*--------------------------------------------------------------------------*/ 
+
similarity index 90%
rename from scilab/modules/fileio/src/c/mputl.h
rename to scilab/modules/fileio/src/cpp/mputl.h
index b855f42..cb04c80 100644 (file)
@@ -13,6 +13,8 @@
 #ifndef __MPUTL_H__
 #define __MPUTL_H__
 
+#include "dynlib_fileio.h"
+
 typedef enum { 
     MPUTL_NO_ERROR = 0,
     MPUTL_ERROR = 1,
@@ -33,7 +35,7 @@ typedef enum {
 * @param[in] numbers of strings to write
 * @return enum error
 */
-mputlError mputl(int fileDescriptor, char **pStrings, int sizeStrings);
+FILEIO_IMPEXP mputlError mputl(int _iFileId, wchar_t **pstStrings, int _iSizeStrings);
 
 #endif /* __MPUTL_H__ */
 /*--------------------------------------------------------------------------*/
index 3b8c784..728369f 100644 (file)
@@ -46,7 +46,7 @@ namespace types
        {
                int* piVal;
                CreateBool(1, 1, &piVal);
-               piVal[0] = _iReal;
+        piVal[0] = _iReal == 0 ? 0 : 1;
                return;
        }
 
index 462d176..c7533b9 100644 (file)
@@ -77,7 +77,7 @@ namespace types
                 dblBin = 1;
             }
         }
-        //hummm beautifull thing ....
+
         return 100 * dblMode + 10 * dblPlus + dblBin;
     }