fix windows compilation after https://codereview.scilab.org/#/c/16742 and clean delet... 44/16744/2
Antoine ELIAS [Mon, 29 Jun 2015 16:10:03 +0000 (18:10 +0200)]
Change-Id: Ib38a983528ef8040230f7e09021d0b1b36dd6d78

24 files changed:
scilab/modules/ast/fileio_Import.def
scilab/modules/ast/src/cpp/ast/runvisitor.cpp
scilab/modules/fileio/Makefile.am
scilab/modules/fileio/Makefile.in
scilab/modules/fileio/fileio.vcxproj
scilab/modules/fileio/fileio.vcxproj.filters
scilab/modules/fileio/includes/filemanager_interface.h [new file with mode: 0644]
scilab/modules/fileio/includes/filesmanagement.h [deleted file]
scilab/modules/fileio/includes/mput.h
scilab/modules/fileio/sci_gateway/c/sci_maxfiles.c
scilab/modules/fileio/src/c/filesmanagement.c [deleted file]
scilab/modules/fileio/src/c/mgeti.c [deleted file]
scilab/modules/fileio/src/c/mgeti.h [deleted file]
scilab/modules/fileio/src/c/mputi.c [deleted file]
scilab/modules/fileio/src/c/mputi.h [deleted file]
scilab/modules/fileio/src/cpp/addfile.cpp
scilab/modules/fileio/src/cpp/filemanager_interface.cpp [new file with mode: 0644]
scilab/modules/fileio/src/cpp/mclose.cpp
scilab/modules/fileio/src/cpp/mget.cpp
scilab/modules/fileio/src/cpp/mgetl.cpp
scilab/modules/fileio/src/cpp/mgetstr.cpp
scilab/modules/fileio/src/cpp/mput.cpp
scilab/modules/fileio/src/cpp/mseek.cpp
scilab/modules/fileio/src/cpp/mtell.cpp

index 864acab..2be9e6c 100644 (file)
@@ -4,4 +4,5 @@ LIBRARY    fileio.dll
 EXPORTS
 removedir
 getshortpathname
-FileExistW
\ No newline at end of file
+FileExistW
+getfile_filename
index 6951ec6..7d0cb9e 100644 (file)
@@ -36,7 +36,7 @@
 
 #include "macrofile.hxx"
 #include "macro.hxx"
-#include "filemanager.hxx"
+#include "filemanager_interface.h"
 
 #include "runner.hxx"
 #include "threadmanagement.hxx"
@@ -935,12 +935,12 @@ void RunVisitorT<T>::visitprivate(const SeqExp  &e)
                 if (pITMacro)
                 {
                     types::Macro* pMacro = pITMacro->getAs<types::Macro>();
-                    types::File* pFile = FileManager::getFile(iFileID);
+                    const wchar_t* filename = getfile_filename(iFileID);
                     // scilab.quit is not open with mopen
-                    // in this case pFile is NULL because FileManager have not been filled.
-                    if (pFile)
+                    // in this case filename is NULL because FileManager have not been filled.
+                    if (filename)
                     {
-                        pMacro->setFileName(pFile->getFilename());
+                        pMacro->setFileName(filename);
                     }
                 }
             }
index 1ab1ea2..8860ffd 100644 (file)
@@ -10,9 +10,6 @@ FILEIO_C_SOURCES = \
     src/c/do_xxscanf.c \
     src/c/findfiles.c \
     src/c/Status2Mode.c \
-    src/c/filesmanagement.c \
-    src/c/mgeti.c \
-    src/c/mputi.c \
     src/c/readline.c \
     src/c/getdrives.c \
     src/c/deleteafile.c \
@@ -96,6 +93,7 @@ GATEWAY_CPP_SOURCES = \
 
 FILEIO_CPP_SOURCES = \
        src/cpp/expandPathVariable.cpp \
+       src/cpp/filemanager_interface.cpp \
        src/cpp/mopen.cpp \
        src/cpp/mclose.cpp \
        src/cpp/mput.cpp \
index 7dc4c9b..d4867ea 100644 (file)
@@ -172,9 +172,6 @@ am__objects_1 = src/c/libscifileio_algo_la-FileExist.lo \
        src/c/libscifileio_algo_la-do_xxscanf.lo \
        src/c/libscifileio_algo_la-findfiles.lo \
        src/c/libscifileio_algo_la-Status2Mode.lo \
-       src/c/libscifileio_algo_la-filesmanagement.lo \
-       src/c/libscifileio_algo_la-mgeti.lo \
-       src/c/libscifileio_algo_la-mputi.lo \
        src/c/libscifileio_algo_la-readline.lo \
        src/c/libscifileio_algo_la-getdrives.lo \
        src/c/libscifileio_algo_la-deleteafile.lo \
@@ -204,6 +201,7 @@ am__objects_1 = src/c/libscifileio_algo_la-FileExist.lo \
        src/c/libscifileio_algo_la-dlManager.lo \
        src/c/libscifileio_algo_la-convert_tools.lo
 am__objects_2 = src/cpp/libscifileio_algo_la-expandPathVariable.lo \
+       src/cpp/libscifileio_algo_la-filemanager_interface.lo \
        src/cpp/libscifileio_algo_la-mopen.lo \
        src/cpp/libscifileio_algo_la-mclose.lo \
        src/cpp/libscifileio_algo_la-mput.lo \
@@ -659,9 +657,6 @@ FILEIO_C_SOURCES = \
     src/c/do_xxscanf.c \
     src/c/findfiles.c \
     src/c/Status2Mode.c \
-    src/c/filesmanagement.c \
-    src/c/mgeti.c \
-    src/c/mputi.c \
     src/c/readline.c \
     src/c/getdrives.c \
     src/c/deleteafile.c \
@@ -745,6 +740,7 @@ GATEWAY_CPP_SOURCES = \
 
 FILEIO_CPP_SOURCES = \
        src/cpp/expandPathVariable.cpp \
+       src/cpp/filemanager_interface.cpp \
        src/cpp/mopen.cpp \
        src/cpp/mclose.cpp \
        src/cpp/mput.cpp \
@@ -995,12 +991,6 @@ src/c/libscifileio_algo_la-findfiles.lo: src/c/$(am__dirstamp) \
        src/c/$(DEPDIR)/$(am__dirstamp)
 src/c/libscifileio_algo_la-Status2Mode.lo: src/c/$(am__dirstamp) \
        src/c/$(DEPDIR)/$(am__dirstamp)
-src/c/libscifileio_algo_la-filesmanagement.lo: src/c/$(am__dirstamp) \
-       src/c/$(DEPDIR)/$(am__dirstamp)
-src/c/libscifileio_algo_la-mgeti.lo: src/c/$(am__dirstamp) \
-       src/c/$(DEPDIR)/$(am__dirstamp)
-src/c/libscifileio_algo_la-mputi.lo: src/c/$(am__dirstamp) \
-       src/c/$(DEPDIR)/$(am__dirstamp)
 src/c/libscifileio_algo_la-readline.lo: src/c/$(am__dirstamp) \
        src/c/$(DEPDIR)/$(am__dirstamp)
 src/c/libscifileio_algo_la-getdrives.lo: src/c/$(am__dirstamp) \
@@ -1065,6 +1055,8 @@ src/cpp/$(DEPDIR)/$(am__dirstamp):
        @: > src/cpp/$(DEPDIR)/$(am__dirstamp)
 src/cpp/libscifileio_algo_la-expandPathVariable.lo:  \
        src/cpp/$(am__dirstamp) src/cpp/$(DEPDIR)/$(am__dirstamp)
+src/cpp/libscifileio_algo_la-filemanager_interface.lo:  \
+       src/cpp/$(am__dirstamp) src/cpp/$(DEPDIR)/$(am__dirstamp)
 src/cpp/libscifileio_algo_la-mopen.lo: src/cpp/$(am__dirstamp) \
        src/cpp/$(DEPDIR)/$(am__dirstamp)
 src/cpp/libscifileio_algo_la-mclose.lo: src/cpp/$(am__dirstamp) \
@@ -1338,7 +1330,6 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/$(DEPDIR)/libscifileio_algo_la-dlManager.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/$(DEPDIR)/libscifileio_algo_la-do_xxscanf.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/$(DEPDIR)/libscifileio_algo_la-fileinfo.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/c/$(DEPDIR)/libscifileio_algo_la-filesmanagement.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/$(DEPDIR)/libscifileio_algo_la-findfiles.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/$(DEPDIR)/libscifileio_algo_la-fprintfMat.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/$(DEPDIR)/libscifileio_algo_la-fscanfMat.Plo@am__quote@
@@ -1350,9 +1341,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/$(DEPDIR)/libscifileio_algo_la-getshortpathname.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/$(DEPDIR)/libscifileio_algo_la-isDrive.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/$(DEPDIR)/libscifileio_algo_la-isdir.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/c/$(DEPDIR)/libscifileio_algo_la-mgeti.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/$(DEPDIR)/libscifileio_algo_la-movefile.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/c/$(DEPDIR)/libscifileio_algo_la-mputi.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/$(DEPDIR)/libscifileio_algo_la-os_wfopen.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/$(DEPDIR)/libscifileio_algo_la-pathconvert.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/$(DEPDIR)/libscifileio_algo_la-readline.Plo@am__quote@
@@ -1364,6 +1353,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@src/cpp/$(DEPDIR)/libscifileio_algo_la-delfile.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/cpp/$(DEPDIR)/libscifileio_algo_la-expandPathVariable.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/cpp/$(DEPDIR)/libscifileio_algo_la-filemanager.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/cpp/$(DEPDIR)/libscifileio_algo_la-filemanager_interface.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/cpp/$(DEPDIR)/libscifileio_algo_la-getfiledesc.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/cpp/$(DEPDIR)/libscifileio_algo_la-getfileinfo.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/cpp/$(DEPDIR)/libscifileio_algo_la-getfiletype.Plo@am__quote@
@@ -1438,27 +1428,6 @@ src/c/libscifileio_algo_la-Status2Mode.lo: src/c/Status2Mode.c
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscifileio_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o src/c/libscifileio_algo_la-Status2Mode.lo `test -f 'src/c/Status2Mode.c' || echo '$(srcdir)/'`src/c/Status2Mode.c
 
-src/c/libscifileio_algo_la-filesmanagement.lo: src/c/filesmanagement.c
-@am__fastdepCC_TRUE@   $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscifileio_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT src/c/libscifileio_algo_la-filesmanagement.lo -MD -MP -MF src/c/$(DEPDIR)/libscifileio_algo_la-filesmanagement.Tpo -c -o src/c/libscifileio_algo_la-filesmanagement.lo `test -f 'src/c/filesmanagement.c' || echo '$(srcdir)/'`src/c/filesmanagement.c
-@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) src/c/$(DEPDIR)/libscifileio_algo_la-filesmanagement.Tpo src/c/$(DEPDIR)/libscifileio_algo_la-filesmanagement.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='src/c/filesmanagement.c' object='src/c/libscifileio_algo_la-filesmanagement.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscifileio_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o src/c/libscifileio_algo_la-filesmanagement.lo `test -f 'src/c/filesmanagement.c' || echo '$(srcdir)/'`src/c/filesmanagement.c
-
-src/c/libscifileio_algo_la-mgeti.lo: src/c/mgeti.c
-@am__fastdepCC_TRUE@   $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscifileio_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT src/c/libscifileio_algo_la-mgeti.lo -MD -MP -MF src/c/$(DEPDIR)/libscifileio_algo_la-mgeti.Tpo -c -o src/c/libscifileio_algo_la-mgeti.lo `test -f 'src/c/mgeti.c' || echo '$(srcdir)/'`src/c/mgeti.c
-@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) src/c/$(DEPDIR)/libscifileio_algo_la-mgeti.Tpo src/c/$(DEPDIR)/libscifileio_algo_la-mgeti.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='src/c/mgeti.c' object='src/c/libscifileio_algo_la-mgeti.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscifileio_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o src/c/libscifileio_algo_la-mgeti.lo `test -f 'src/c/mgeti.c' || echo '$(srcdir)/'`src/c/mgeti.c
-
-src/c/libscifileio_algo_la-mputi.lo: src/c/mputi.c
-@am__fastdepCC_TRUE@   $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscifileio_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT src/c/libscifileio_algo_la-mputi.lo -MD -MP -MF src/c/$(DEPDIR)/libscifileio_algo_la-mputi.Tpo -c -o src/c/libscifileio_algo_la-mputi.lo `test -f 'src/c/mputi.c' || echo '$(srcdir)/'`src/c/mputi.c
-@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) src/c/$(DEPDIR)/libscifileio_algo_la-mputi.Tpo src/c/$(DEPDIR)/libscifileio_algo_la-mputi.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='src/c/mputi.c' object='src/c/libscifileio_algo_la-mputi.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscifileio_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o src/c/libscifileio_algo_la-mputi.lo `test -f 'src/c/mputi.c' || echo '$(srcdir)/'`src/c/mputi.c
-
 src/c/libscifileio_algo_la-readline.lo: src/c/readline.c
 @am__fastdepCC_TRUE@   $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscifileio_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT src/c/libscifileio_algo_la-readline.lo -MD -MP -MF src/c/$(DEPDIR)/libscifileio_algo_la-readline.Tpo -c -o src/c/libscifileio_algo_la-readline.lo `test -f 'src/c/readline.c' || echo '$(srcdir)/'`src/c/readline.c
 @am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) src/c/$(DEPDIR)/libscifileio_algo_la-readline.Tpo src/c/$(DEPDIR)/libscifileio_algo_la-readline.Plo
@@ -1756,6 +1725,13 @@ src/cpp/libscifileio_algo_la-expandPathVariable.lo: src/cpp/expandPathVariable.c
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscifileio_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/cpp/libscifileio_algo_la-expandPathVariable.lo `test -f 'src/cpp/expandPathVariable.cpp' || echo '$(srcdir)/'`src/cpp/expandPathVariable.cpp
 
+src/cpp/libscifileio_algo_la-filemanager_interface.lo: src/cpp/filemanager_interface.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscifileio_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/cpp/libscifileio_algo_la-filemanager_interface.lo -MD -MP -MF src/cpp/$(DEPDIR)/libscifileio_algo_la-filemanager_interface.Tpo -c -o src/cpp/libscifileio_algo_la-filemanager_interface.lo `test -f 'src/cpp/filemanager_interface.cpp' || echo '$(srcdir)/'`src/cpp/filemanager_interface.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_at)$(am__mv) src/cpp/$(DEPDIR)/libscifileio_algo_la-filemanager_interface.Tpo src/cpp/$(DEPDIR)/libscifileio_algo_la-filemanager_interface.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     $(AM_V_CXX)source='src/cpp/filemanager_interface.cpp' object='src/cpp/libscifileio_algo_la-filemanager_interface.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscifileio_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/cpp/libscifileio_algo_la-filemanager_interface.lo `test -f 'src/cpp/filemanager_interface.cpp' || echo '$(srcdir)/'`src/cpp/filemanager_interface.cpp
+
 src/cpp/libscifileio_algo_la-mopen.lo: src/cpp/mopen.cpp
 @am__fastdepCXX_TRUE@  $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscifileio_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/cpp/libscifileio_algo_la-mopen.lo -MD -MP -MF src/cpp/$(DEPDIR)/libscifileio_algo_la-mopen.Tpo -c -o src/cpp/libscifileio_algo_la-mopen.lo `test -f 'src/cpp/mopen.cpp' || echo '$(srcdir)/'`src/cpp/mopen.cpp
 @am__fastdepCXX_TRUE@  $(AM_V_at)$(am__mv) src/cpp/$(DEPDIR)/libscifileio_algo_la-mopen.Tpo src/cpp/$(DEPDIR)/libscifileio_algo_la-mopen.Plo
index 38dba24..879cf35 100644 (file)
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
 <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <ItemGroup Label="ProjectConfigurations">
     <ProjectConfiguration Include="Debug|Win32">
@@ -211,6 +211,7 @@ lib /DEF:"$(ProjectDir)preferences_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Pla
   <ItemGroup>
     <ClCompile Include="src\cpp\addfile.cpp" />
     <ClCompile Include="src\cpp\delfile.cpp" />
+    <ClCompile Include="src\cpp\filemanager_interface.cpp" />
     <ClCompile Include="src\cpp\getfiledesc.cpp" />
     <ClCompile Include="src\cpp\getfileinfo.cpp" />
     <ClCompile Include="src\cpp\getfiletype.cpp" />
@@ -229,7 +230,6 @@ lib /DEF:"$(ProjectDir)preferences_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Pla
     <ClCompile Include="src\c\FileExist.c" />
     <ClCompile Include="src\c\fileinfo.c" />
     <ClCompile Include="src\cpp\filemanager.cpp" />
-    <ClCompile Include="src\c\filesmanagement.c" />
     <ClCompile Include="src\c\FindFileExtension.c" />
     <ClCompile Include="src\c\findfiles.c" />
     <ClCompile Include="src\c\fprintfMat.c" />
@@ -245,13 +245,11 @@ lib /DEF:"$(ProjectDir)preferences_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Pla
     <ClCompile Include="src\c\isDrive.c" />
     <ClCompile Include="src\cpp\mclose.cpp" />
     <ClCompile Include="src\cpp\mget.cpp" />
-    <ClCompile Include="src\c\mgeti.c" />
     <ClCompile Include="src\cpp\mgetl.cpp" />
     <ClCompile Include="src\cpp\mgetstr.cpp" />
     <ClCompile Include="src\cpp\mopen.cpp" />
     <ClCompile Include="src\c\movefile.c" />
     <ClCompile Include="src\cpp\mput.cpp" />
-    <ClCompile Include="src\c\mputi.c" />
     <ClCompile Include="src\cpp\mputl.cpp" />
     <ClCompile Include="src\cpp\mseek.cpp" />
     <ClCompile Include="src\cpp\mtell.cpp" />
@@ -309,7 +307,7 @@ lib /DEF:"$(ProjectDir)preferences_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Pla
     <ClInclude Include="includes\expandPathVariable.h" />
     <ClInclude Include="includes\FileExist.h" />
     <ClInclude Include="includes\filemanager.hxx" />
-    <ClInclude Include="includes\filesmanagement.h" />
+    <ClInclude Include="includes\filemanager_interface.h" />
     <ClInclude Include="includes\FindFileExtension.h" />
     <ClInclude Include="includes\findfiles.h" />
     <ClInclude Include="includes\fullpath.h" />
@@ -348,9 +346,7 @@ lib /DEF:"$(ProjectDir)preferences_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Pla
     <ClInclude Include="src\c\getlongpathname.h" />
     <ClInclude Include="src\c\getrelativefilename.h" />
     <ClInclude Include="src\c\isDrive.h" />
-    <ClInclude Include="src\c\mgeti.h" />
     <ClInclude Include="src\c\movefile.h" />
-    <ClInclude Include="src\c\mputi.h" />
     <ClInclude Include="src\c\pathconvert.h" />
     <ClInclude Include="src\c\Status2Mode.h" />
   </ItemGroup>
index 18a3835..a01801c 100644 (file)
@@ -57,9 +57,6 @@
     <ClCompile Include="src\cpp\filemanager.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="src\c\filesmanagement.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
     <ClCompile Include="src\c\FindFileExtension.c">
       <Filter>Source Files</Filter>
     </ClCompile>
     <ClCompile Include="src\cpp\mget.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="src\c\mgeti.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
     <ClCompile Include="src\cpp\mgetl.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
     <ClCompile Include="src\cpp\mput.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="src\c\mputi.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
     <ClCompile Include="src\cpp\mputl.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
     <ClCompile Include="src\cpp\getfiletype.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
+    <ClCompile Include="src\cpp\filemanager_interface.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="includes\mgetl.h">
     <ClInclude Include="includes\filemanager.hxx">
       <Filter>Header Files</Filter>
     </ClInclude>
-    <ClInclude Include="includes\filesmanagement.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
     <ClInclude Include="includes\FindFileExtension.h">
       <Filter>Header Files</Filter>
     </ClInclude>
     <ClInclude Include="src\c\pathconvert.h">
       <Filter>Header Files</Filter>
     </ClInclude>
-    <ClInclude Include="src\c\mputi.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
     <ClInclude Include="src\c\movefile.h">
       <Filter>Header Files</Filter>
     </ClInclude>
-    <ClInclude Include="src\c\mgeti.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
     <ClInclude Include="src\c\isDrive.h">
       <Filter>Header Files</Filter>
     </ClInclude>
     <ClInclude Include="src\c\convert_tools.h">
       <Filter>Header Files</Filter>
     </ClInclude>
+    <ClInclude Include="includes\filemanager_interface.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <ResourceCompile Include="src\c\fileio.rc">
diff --git a/scilab/modules/fileio/includes/filemanager_interface.h b/scilab/modules/fileio/includes/filemanager_interface.h
new file mode 100644 (file)
index 0000000..1362fcf
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+*  Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+*  Copyright (C) 2015 - Scilab Enterprises - Antoine ELIAS
+*
+*  This file must be used under the terms of the CeCILL.
+*  This source file is licensed as described in the file COPYING, which
+*  you should have received as part of this distribution.  The terms
+*  are also available at
+*  http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+*
+*/
+
+#include "dynlib_fileio.h"
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+FILEIO_IMPEXP const wchar_t* getfile_filename(int uid);
+#ifdef __cplusplus
+};
+#endif /* extern "C" */
diff --git a/scilab/modules/fileio/includes/filesmanagement.h b/scilab/modules/fileio/includes/filesmanagement.h
deleted file mode 100644 (file)
index 6972946..0000000
+++ /dev/null
@@ -1,222 +0,0 @@
-/*
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) 2007 - INRIA - Allan CORNET
- *
- * This file must be used under the terms of the CeCILL.
- * This source file is licensed as described in the file COPYING, which
- * you should have received as part of this distribution.  The terms
- * are also available at
- * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
- *
- */
-
-#ifndef __FILESMANAGEMENT_H__
-#define __FILESMANAGEMENT_H__
-
-#include <stdio.h>
-#include "dynlib_fileio.h"
-#include "BOOL.h"
-
-/* ID returned if File is not defined */
-#define FILE_ID_NOT_DEFINED -100
-
-/**
-* Default max of files opened in scilab
-*/
-#ifdef FOPEN_MAX
-#define DEFAULT_MAX_FILES FOPEN_MAX
-#else
-#define DEFAULT_MAX_FILES 20
-#endif
-/**
-* Get max of files opened in scilab
-* @return max of files opened in scilab
-*/
-FILEIO_IMPEXP int GetMaximumFileOpenedInScilab(void);
-
-/**
-* Get the file associated to int Id
-* @param Id
-* @return FILE ptr
-*/
-FILEIO_IMPEXP FILE *GetFileOpenedInScilab(int Id);
-
-/**
-* Set the file associated to int Id
-* @param FILE ptr
-* @param Id
-*/
-FILEIO_IMPEXP void SetFileOpenedInScilab(int Id, FILE *fptr);
-
-/**
-* Get the current Id (current file)
-* @return Id
-*/
-FILEIO_IMPEXP int GetCurrentFileId(void);
-
-/**
-* Get the previous Id (previous file)
-* @return Id
-*/
-FILEIO_IMPEXP int GetPreviousFileId(void);
-
-/**
-* Set the current Id (current file)
-* @param Id
-*/
-FILEIO_IMPEXP void SetCurrentFileId(int Id);
-
-/**
-* Get the swap status of file Id
-* @param Id
-* @return swap status
-*/
-FILEIO_IMPEXP int GetSwapStatus(int Id);
-
-/**
-* Set the swap status of file Id
-* @param Id
-* @param new swap
-*/
-FILEIO_IMPEXP void SetSwapStatus(int Id, int newswap);
-
-/**
-* Get the mode of file Id
-* @param Id
-* @return mode
-*/
-FILEIO_IMPEXP int GetFileModeOpenedInScilab(int Id);
-
-/**
-* Set the mode of file Id
-* @param Id
-* @param new mode
-*/
-FILEIO_IMPEXP void SetFileModeOpenedInScilab(int Id, int mode);
-
-/**
-* Get the type of file Id
-* @param Id
-* @return Type (Fortran,C)
-*/
-FILEIO_IMPEXP int GetFileTypeOpenedInScilab(int Id);
-
-
-/**
-* Get the type of file Id
-* @param Id
-* @return Type 'C' or 'F' (Fortran,C) (to free)
-*/
-FILEIO_IMPEXP char *GetFileTypeOpenedInScilabAsString(int Id);
-
-/**
-* Set the mode of file Id
-* @param Id
-* @param new Type (Fortran,C)
-*/
-FILEIO_IMPEXP void SetFileTypeOpenedInScilab(int Id, int Type);
-
-/**
-* Get the name of file Id
-* @param Id
-* @return name
-*/
-FILEIO_IMPEXP char* GetFileNameOpenedInScilab(int Id);
-
-/**
-* Set the name of file Id
-* @param Id
-* @param new name
-* @return TRUE or FALSE
-*/
-FILEIO_IMPEXP BOOL SetFileNameOpenedInScilab(int Id, char *name);
-
-/**
-* Free filename of file Id
-* @param Id
-* @return TRUE or FALSE
-*/
-FILEIO_IMPEXP BOOL FreeFileNameOpenedInScilab(int Id);
-
-/**
-* Initialize Scilab's file list
-* @return TRUE or FALSE
-*/
-FILEIO_IMPEXP BOOL InitializeScilabFilesList(void);
-
-/**
-* Terminate Scilab's file list
-* @return TRUE or FALSE
-*/
-FILEIO_IMPEXP BOOL TerminateScilabFilesList(void);
-
-/**
-* Extend Scilab's file list
-* @return TRUE or FALSE
-*/
-FILEIO_IMPEXP BOOL ExtendScilabFilesList(int NewSize);
-
-/**
-* Search if filename is already opened in Scilab
-* @return TRUE or FALSE
-*/
-FILEIO_IMPEXP BOOL IsAlreadyOpenedInScilab(char *filename);
-
-/**
-* Get ID of a filename opened in scilab
-* @param[in] filename
-* @return file ID or FILE_ID_NOT_DEFINED
-*/
-FILEIO_IMPEXP int GetIdFromFilename(char *filename);
-
-/**
-* Get Ids opened in Scilab
-* @param[out] size of returned array
-* @return Array of Id
-*/
-FILEIO_IMPEXP double *GetFilesIdUsed(int *sizeArrayReturned);
-
-/**
-* Get Ids opened in Scilab
-* @param[out] size of returned array
-* @return Array of Id
-*/
-FILEIO_IMPEXP double *GetSwapsUsed(int *sizeArrayReturned);
-
-/**
-* Get Modes used in Scilab
-* @param[out] size of returned array
-* @return Modes associated to Id
-*/
-FILEIO_IMPEXP double *GetModesUsed(int *sizeArrayReturned);
-
-/**
-* Get Types used in Scilab
-* @param[out] size of returned array
-* @return Types associated to Id
-*/
-FILEIO_IMPEXP int *GetTypesUsed(int *sizeArrayReturned);
-
-/**
-* Get Types used in Scilab
-* @param[out] size of returned array
-* @return Types associated to Id as Strings (user reading)
-*/
-FILEIO_IMPEXP char **GetTypesUsedAsString(int *sizeArrayReturned);
-
-/**
-* Get filenames used in Scilab
-* @param[out] size of returned array
-* @return filenames
-*/
-FILEIO_IMPEXP char **GetFilenamesUsed(int *sizeArrayReturned);
-
-/**
-* Get number of Ids Used in Scilab
-* @return number of Ids
-*/
-FILEIO_IMPEXP int GetNumberOfIdsUsed(void);
-
-#endif /* __FILESMANAGEMENT_H__ */
-/*--------------------------------------------------------------------------*/
-
index a5c3567..ea05d53 100644 (file)
@@ -24,8 +24,6 @@
 */
 FILEIO_IMPEXP void C2F(mput) (int *fd, double *res, int *n, char *type, int *ierr);
 
-FILEIO_IMPEXP void C2F(mputnc) (int *fd, void * res, int *n1, char *type, int *ierr);
-
 FILEIO_IMPEXP void mput2 (FILE *fa, int swap2, double *res, int n, char *type, int *ierr);
 
 #endif /* __MPUT_H__ */
index 5bab6ab..587cdbd 100644 (file)
@@ -15,7 +15,6 @@
 #include "stack-c.h"
 #include "sci_malloc.h"
 #include "Scierror.h"
-#include "filesmanagement.h"
 #include "localization.h"
 #include "sciprint.h"
 /*--------------------------------------------------------------------------*/
diff --git a/scilab/modules/fileio/src/c/filesmanagement.c b/scilab/modules/fileio/src/c/filesmanagement.c
deleted file mode 100644 (file)
index 72af393..0000000
+++ /dev/null
@@ -1,518 +0,0 @@
-/*
-* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-* Copyright (C) 2007 - 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.1-en.txt
-*
-*/
-#include <string.h>
-#include <stdlib.h>
-#include "PATH_MAX.h"
-#include "filesmanagement.h"
-#include "core_math.h" /* Min Max */
-#include "sci_malloc.h"
-#include "os_string.h"
-#include "fullpath.h"
-/*--------------------------------------------------------------------------*/
-typedef struct
-{
-    FILE *ftformat;
-    int ftswap; /* swap status for each file */
-    int ftmode; /* mode for each file */
-    int fttype; /* type (Fortran,C) for each file must be zero initialized */
-    char *ftname; /* name for each file */
-
-} scilabfile;
-/*--------------------------------------------------------------------------*/
-static scilabfile *ScilabFileList = NULL;
-static int CurFile = -1;
-static int PreviousFile = -1;
-static int CurrentMaxFiles = DEFAULT_MAX_FILES;
-/*--------------------------------------------------------------------------*/
-FILE *GetFileOpenedInScilab(int Id)
-{
-    int fd1 = 0;
-
-    fd1 = (Id != -1) ?  Min(Max(Id, 0), GetMaximumFileOpenedInScilab() - 1) : CurFile ;
-
-    if ( fd1 != -1 )
-    {
-        return  ScilabFileList[fd1].ftformat;
-    }
-    return NULL;
-}
-/*--------------------------------------------------------------------------*/
-int GetCurrentFileId(void)
-{
-    return CurFile;
-}
-/*--------------------------------------------------------------------------*/
-int GetPreviousFileId(void)
-{
-    return PreviousFile;
-}
-/*--------------------------------------------------------------------------*/
-void SetCurrentFileId(int Id)
-{
-    if (Id == -1)
-    {
-        PreviousFile = -1;
-    }
-    else
-    {
-        PreviousFile = CurFile;
-    }
-
-    CurFile = Id;
-}
-/*--------------------------------------------------------------------------*/
-void SetFileOpenedInScilab(int Id, FILE *fptr)
-{
-    ScilabFileList[Id].ftformat = fptr;
-}
-/*--------------------------------------------------------------------------*/
-int GetSwapStatus(int Id)
-{
-    int fd1;
-    fd1 = (Id != -1) ?  Min(Max(Id, 0), GetMaximumFileOpenedInScilab() - 1) : GetCurrentFileId() ;
-    if ( fd1 != -1 )
-    {
-        return(ScilabFileList[fd1].ftswap);
-    }
-    return(0);
-}
-/*--------------------------------------------------------------------------*/
-void SetSwapStatus(int Id, int newswap)
-{
-    ScilabFileList[Id].ftswap =  newswap;
-}
-/*--------------------------------------------------------------------------*/
-int GetMaximumFileOpenedInScilab(void)
-{
-    return CurrentMaxFiles;
-}
-/*--------------------------------------------------------------------------*/
-int GetFileModeOpenedInScilab(int Id)
-{
-    return ScilabFileList[Id].ftmode;
-}
-/*--------------------------------------------------------------------------*/
-void SetFileModeOpenedInScilab(int Id, int mode)
-{
-    ScilabFileList[Id].ftmode = mode;
-}
-/*--------------------------------------------------------------------------*/
-int GetFileTypeOpenedInScilab(int Id)
-{
-    if ( (Id > 0) && (Id < GetMaximumFileOpenedInScilab()) )
-    {
-        return ScilabFileList[Id].fttype;
-    }
-    else
-    {
-        return 0;
-    }
-}
-/*--------------------------------------------------------------------------*/
-char *GetFileTypeOpenedInScilabAsString(int Id)
-{
-    char *ret = NULL;
-    switch (GetFileTypeOpenedInScilab(Id))
-    {
-        case 1:
-            ret = os_strdup("F");
-            break;
-        case 2:
-            ret = os_strdup("C");
-            break;
-        case 0:
-        default:
-            ret = os_strdup("Error");
-            break;
-    }
-    return ret;
-}
-/*--------------------------------------------------------------------------*/
-void SetFileTypeOpenedInScilab(int Id, int Type)
-{
-    ScilabFileList[Id].fttype = Type;
-}
-/*--------------------------------------------------------------------------*/
-char* GetFileNameOpenedInScilab(int Id)
-{
-    if (GetFileTypeOpenedInScilab(Id) == 1) // Fortran file
-    {
-        /* A exception for Id 5 and 6 */
-        /* no name */
-        if ((Id != 5) && (Id != 6))
-        {
-            return ScilabFileList[Id].ftname;
-        }
-    }
-    else
-    {
-        if (GetFileOpenedInScilab(Id) != NULL)
-        {
-            return ScilabFileList[Id].ftname;
-        }
-    }
-    return NULL;
-}
-/*--------------------------------------------------------------------------*/
-BOOL SetFileNameOpenedInScilab(int Id, char *name)
-{
-    BOOL bOK = FALSE;
-    char *ptrName = NULL;
-    char fullpath[PATH_MAX * 4];
-
-    /* A exception for Id 5 and 6 */
-    /* no filename */
-    if ( name[0] == '\0' )
-    {
-        ptrName = "";
-        bOK = TRUE;
-    }
-    else
-    {
-        if ( get_full_path( fullpath, name, PATH_MAX * 4 ) != NULL )
-        {
-            ptrName = os_strdup(fullpath);
-            if (ptrName)
-            {
-                bOK = TRUE;
-            }
-        }
-        else
-        {
-            ptrName = os_strdup(name);
-            if (ptrName)
-            {
-                bOK = TRUE;
-            }
-        }
-    }
-    ScilabFileList[Id].ftname = ptrName;
-    return bOK;
-}
-/*--------------------------------------------------------------------------*/
-BOOL FreeFileNameOpenedInScilab(int Id)
-{
-    char *ptr = ScilabFileList[Id].ftname;
-    if (ptr && ptr[0])
-    {
-        FREE(ptr);
-        ptr = NULL;
-        return TRUE;
-    }
-    return FALSE;
-}
-/*--------------------------------------------------------------------------*/
-BOOL InitializeScilabFilesList(void)
-{
-    if (!ScilabFileList)
-    {
-        CurrentMaxFiles = DEFAULT_MAX_FILES;
-        ScilabFileList = (scilabfile *) MALLOC(sizeof(scilabfile) * CurrentMaxFiles);
-
-        if (ScilabFileList)
-        {
-            int i = 0;
-            scilabfile initializedScilabFile;
-
-            initializedScilabFile.ftformat = NULL;
-            initializedScilabFile.ftmode = 0;
-            initializedScilabFile.ftname = NULL;
-            initializedScilabFile.ftswap = 0;
-            initializedScilabFile.fttype = 0;
-
-            for (i = 0; i < CurrentMaxFiles; i++)
-            {
-                scilabfile *ptrScilabFile = &ScilabFileList[i];
-                memcpy(ptrScilabFile, &initializedScilabFile, sizeof(scilabfile));
-            }
-            return TRUE;
-        }
-    }
-    return FALSE;
-}
-/*--------------------------------------------------------------------------*/
-BOOL TerminateScilabFilesList(void)
-{
-    if (ScilabFileList)
-    {
-        FREE(ScilabFileList);
-        ScilabFileList = NULL;
-        return TRUE;
-    }
-    return FALSE;
-}
-/*--------------------------------------------------------------------------*/
-BOOL ExtendScilabFilesList(int NewSize)
-{
-    if (ScilabFileList)
-    {
-        if (NewSize > CurrentMaxFiles)
-        {
-
-            scilabfile *ScilabFileListTmp = NULL;
-            ScilabFileListTmp = (scilabfile *)REALLOC(ScilabFileList, NewSize * sizeof(scilabfile));
-            if (ScilabFileListTmp)
-            {
-                int i = 0;
-                ScilabFileList = ScilabFileListTmp;
-                for (i = CurrentMaxFiles; i < NewSize; i++)
-                {
-                    ScilabFileList[i].ftformat = NULL;
-                    ScilabFileList[i].ftmode = 0;
-                    ScilabFileList[i].ftname = NULL;
-                    ScilabFileList[i].ftswap = 0;
-                    ScilabFileList[i].fttype = 0;
-                }
-                CurrentMaxFiles = NewSize;
-                return TRUE;
-            }
-        }
-    }
-    return FALSE;
-}
-/*--------------------------------------------------------------------------*/
-BOOL IsAlreadyOpenedInScilab(char *filename)
-{
-    if (ScilabFileList)
-    {
-        char fullpath[PATH_MAX * 4] = {0};
-        int i = 0;
-
-        if (filename == NULL || strcmp(filename, "") == 0)
-        {
-            return FALSE;
-        }
-
-        if ( get_full_path( fullpath, filename, PATH_MAX * 4 ) == NULL )
-        {
-            /* if we are a problem */
-            strncpy(fullpath, filename, sizeof(fullpath));
-        }
-
-        for (i = 0; i < CurrentMaxFiles; i++)
-        {
-            if ( (ScilabFileList[i].ftformat) && ScilabFileList[i].ftname)
-            {
-                if (strcmp(ScilabFileList[i].ftname, fullpath) == 0)
-                {
-                    return TRUE;
-                }
-            }
-        }
-    }
-    return FALSE;
-}
-/*--------------------------------------------------------------------------*/
-int GetIdFromFilename(char *filename)
-{
-    if (ScilabFileList)
-    {
-        char fullpath[PATH_MAX * 4] = {0};
-        int i = 0;
-        if ( get_full_path( fullpath, filename, PATH_MAX * 4 ) == NULL )
-        {
-            /* if we are a problem */
-            strncpy(fullpath, filename, sizeof(fullpath));
-        }
-
-        for (i = 0; i < CurrentMaxFiles; i++)
-        {
-            if ( (ScilabFileList[i].ftformat) && ScilabFileList[i].ftname)
-            {
-                if (strcmp(ScilabFileList[i].ftname, fullpath) == 0)
-                {
-                    return i;
-                }
-            }
-        }
-    }
-    return FILE_ID_NOT_DEFINED;
-}
-/*--------------------------------------------------------------------------*/
-double *GetFilesIdUsed(int *sizeArrayReturned)
-{
-    int i = 0, j = 0;
-    double* ArrayIdUsed = NULL;
-    *sizeArrayReturned = GetNumberOfIdsUsed();
-
-    ArrayIdUsed = (double*)MALLOC(sizeof(double) * (*sizeArrayReturned));
-    if (ArrayIdUsed == NULL)
-    {
-        *sizeArrayReturned = 0;
-        return NULL;
-    }
-
-    j = 0;
-    for (i = 0; i < GetMaximumFileOpenedInScilab(); i++)
-    {
-        if (GetFileTypeOpenedInScilab(i) != 0)
-        {
-            ArrayIdUsed[j] = (double)i;
-            j++;
-        }
-    }
-    return ArrayIdUsed;
-}
-/*--------------------------------------------------------------------------*/
-double *GetSwapsUsed(int *sizeArrayReturned)
-{
-    double *ArraySwapUsed = NULL;
-    int i = 0, j = 0;
-
-    *sizeArrayReturned = GetNumberOfIdsUsed();
-
-    ArraySwapUsed = (double*)MALLOC(sizeof(double) * (*sizeArrayReturned));
-    if (ArraySwapUsed == NULL)
-    {
-        *sizeArrayReturned = 0;
-        return NULL;
-    }
-
-    j = 0;
-    for (i = 0; i < GetMaximumFileOpenedInScilab(); i++)
-    {
-        if (GetFileTypeOpenedInScilab(i) != 0)
-        {
-            ArraySwapUsed[j] = (double)GetSwapStatus(i);
-            j++;
-        }
-    }
-    return ArraySwapUsed;
-}
-/*--------------------------------------------------------------------------*/
-double *GetModesUsed(int *sizeArrayReturned)
-{
-    double *ArrayModeUsed = NULL;
-    int i = 0, j = 0;
-
-    *sizeArrayReturned = GetNumberOfIdsUsed();
-
-    ArrayModeUsed = (double*)MALLOC(sizeof(double) * (*sizeArrayReturned));
-    if (ArrayModeUsed == NULL)
-    {
-        *sizeArrayReturned = 0;
-        return NULL;
-    }
-
-    j = 0;
-    for (i = 0; i < GetMaximumFileOpenedInScilab(); i++)
-    {
-        if (GetFileTypeOpenedInScilab(i) != 0)
-        {
-            ArrayModeUsed[j] = (double)GetFileModeOpenedInScilab(i);
-            j++;
-        }
-    }
-    return ArrayModeUsed;
-}
-/*--------------------------------------------------------------------------*/
-int *GetTypesUsed(int *sizeArrayReturned)
-{
-    int *ArrayTypeUsed = NULL;
-    int i = 0, j = 0;
-
-    *sizeArrayReturned = GetNumberOfIdsUsed();
-
-    ArrayTypeUsed = (int*)MALLOC(sizeof(int) * (*sizeArrayReturned));
-    if (ArrayTypeUsed == NULL)
-    {
-        *sizeArrayReturned = 0;
-        return NULL;
-    }
-
-    j = 0;
-    for (i = 0; i < GetMaximumFileOpenedInScilab(); i++)
-    {
-        if (GetFileTypeOpenedInScilab(i) != 0)
-        {
-            ArrayTypeUsed[j] = GetFileTypeOpenedInScilab(i);
-            j++;
-        }
-    }
-    return ArrayTypeUsed;
-}
-/*--------------------------------------------------------------------------*/
-char **GetTypesUsedAsString(int *sizeArrayReturned)
-{
-    char **ArrayTypeUsedAsString = NULL;
-    int i = 0, j = 0;
-
-    *sizeArrayReturned = GetNumberOfIdsUsed();
-
-    ArrayTypeUsedAsString = (char**)MALLOC(sizeof(char*) * (*sizeArrayReturned));
-    if (ArrayTypeUsedAsString == NULL)
-    {
-        *sizeArrayReturned = 0;
-        return NULL;
-    }
-
-    j = 0;
-    for (i = 0; i < GetMaximumFileOpenedInScilab(); i++)
-    {
-        if (GetFileTypeOpenedInScilab(i) != 0)
-        {
-            ArrayTypeUsedAsString[j] = GetFileTypeOpenedInScilabAsString(i);
-            j++;
-        }
-    }
-    return ArrayTypeUsedAsString;
-}
-/*--------------------------------------------------------------------------*/
-char **GetFilenamesUsed(int *sizeArrayReturned)
-{
-    char **FilenamesArray = NULL;
-    int i = 0, j = 0;
-
-    *sizeArrayReturned = GetNumberOfIdsUsed();
-
-    FilenamesArray = (char**)MALLOC(sizeof(char*) * (*sizeArrayReturned));
-    if (FilenamesArray == NULL)
-    {
-        *sizeArrayReturned = 0;
-        return NULL;
-    }
-
-    j = 0;
-    for (i = 0; i < GetMaximumFileOpenedInScilab(); i++)
-    {
-        if (GetFileTypeOpenedInScilab(i) != 0)
-        {
-            if (GetFileNameOpenedInScilab(i))
-            {
-                FilenamesArray[j] = os_strdup(GetFileNameOpenedInScilab(i));
-            }
-            else
-            {
-                FilenamesArray[j] = os_strdup("");
-            }
-            j++;
-        }
-    }
-    return FilenamesArray;
-}
-/*--------------------------------------------------------------------------*/
-int GetNumberOfIdsUsed(void)
-{
-    int i = 0;
-    int numberOfIds = 0;
-
-    for (i = 0; i < GetMaximumFileOpenedInScilab(); i++)
-    {
-        if (GetFileTypeOpenedInScilab(i) != 0)
-        {
-            numberOfIds++;
-        }
-    }
-    return numberOfIds;
-}
-/*--------------------------------------------------------------------------*/
diff --git a/scilab/modules/fileio/src/c/mgeti.c b/scilab/modules/fileio/src/c/mgeti.c
deleted file mode 100644 (file)
index 842f2a4..0000000
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
-* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-* Copyright (C) INRIA -
-*
-* This file must be used under the terms of the CeCILL.
-* This source file is licensed as described in the file COPYING, which
-* you should have received as part of this distribution.  The terms
-* are also available at
-* http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
-*
-*/
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include "mgeti.h"
-#include "sciprint.h"
-#include "filesmanagement.h"
-#include "islittleendian.h"
-#include "localization.h"
-#include "convert_tools.h"
-
-/*****************************************************************
-* read n items of type type
-* if read fails *ierr contains the number of properly read items
-****************************************************************/
-void C2F(mgeti)(int* _pF, long long* _pVal, int* _iSize, char* _iOpt, int* _iErr)
-{
-    int iType = 0;
-    int iUnsigned = 0;
-    int iEndian = 0;
-
-    int iTypeLen = (int)strlen(_iOpt);
-    int i;
-    int iCount = -1;
-    FILE *fa = NULL;
-
-    unsigned char *RES_uc   = (unsigned char *)_pVal;
-    unsigned int *RES_ui    = (unsigned int*)_pVal;
-    unsigned short *RES_us  = (unsigned short *)_pVal;
-
-    fa = GetFileOpenedInScilab(*_pF);
-    if (fa == NULL)
-    {
-        sciprint(_("%s: No input file.\n"), "mputi");
-        *_iErr = 1;
-        return;
-    }
-
-    if (iTypeLen == 1)
-    {
-        //type only
-        iUnsigned = SIGNED;
-        iType = checkType(_iOpt[0]);
-    }
-    else if (iTypeLen == 2)
-    {
-        if (_iOpt[0] == 'u')
-        {
-            //unsigned + type
-            iUnsigned = UNSIGNED;
-            iType = checkType(_iOpt[1]);
-        }
-        else
-        {
-            //type + endian
-            iUnsigned = SIGNED;
-            iType = checkType(_iOpt[0]);
-            iEndian = checkEndian(_iOpt[1]);
-        }
-    }
-    else if (iTypeLen == 3)
-    {
-        if (_iOpt[0] == 'u')
-        {
-            //unsigned + type
-            iUnsigned = UNSIGNED;
-            iType = checkType(_iOpt[1]);
-            iEndian = checkEndian(_iOpt[2]);
-        }
-    }
-
-    if (iEndian == 0)
-    {
-        //endian can be setting up by mopen call with flag swap
-        if (GetSwapStatus(*_pF))
-        {
-            iEndian = islittleendian() ? BIG_ENDIAN : LITTLE_ENDIAN;
-        }
-        else
-        {
-            iEndian = islittleendian() ? LITTLE_ENDIAN : BIG_ENDIAN;
-        }
-    }
-    else
-    {
-        if (iEndian == LITTLE_ENDIAN)
-        {
-            iEndian = islittleendian() ? LITTLE_ENDIAN : BIG_ENDIAN;
-        }
-        else
-        {
-            iEndian = islittleendian() ? BIG_ENDIAN : LITTLE_ENDIAN;
-        }
-    }
-
-    if (iType == 0 || iEndian == 0 || iUnsigned == 0)
-    {
-        sciprint(_("%s: %s format not recognized.\n"), "mputi", _iOpt);
-        *_iErr = 1;
-        return;
-    }
-
-
-    switch (iType)
-    {
-        case TYPE_LONG_LONG :
-            for (i = 0 ; i < *_iSize ; i++)
-            {
-                unsigned long long val;
-                *_iErr = readLongLong(fa, iEndian, &val);
-                if (*_iErr || feof(fa))
-                {
-                    iCount = i;
-                    break;
-                }
-
-                //be careful, only because scilab 5 does not manage int64
-                *RES_ui++ = (unsigned int)val;
-            }
-            break;
-        case TYPE_INT :
-            for (i = 0 ; i < *_iSize ; i++)
-            {
-                unsigned int val;
-                *_iErr = readInt(fa, iEndian, &val);
-                if (*_iErr || feof(fa))
-                {
-                    iCount = i;
-                    break;
-                }
-
-                *RES_ui++ = val;
-            }
-            break;
-        case TYPE_SHORT :
-            for (i = 0 ; i < *_iSize ; i++)
-            {
-                unsigned short val;
-                *_iErr = readShort(fa, iEndian, &val);
-                if (*_iErr || feof(fa))
-                {
-                    iCount = i;
-                    break;
-                }
-
-                *RES_us++ = val;
-            }
-            break;
-        case TYPE_CHAR:
-            for (i = 0 ; i < *_iSize ; i++)
-            {
-                unsigned char val;
-                *_iErr = readChar(fa, iEndian, &val);
-                if (*_iErr || feof(fa))
-                {
-                    iCount = i;
-                    break;
-                }
-
-                *RES_uc++ = val;
-            }
-            break;
-    }
-
-    if (iCount != -1)
-    {
-        *_iErr = - iCount - 1;
-    }
-}
diff --git a/scilab/modules/fileio/src/c/mgeti.h b/scilab/modules/fileio/src/c/mgeti.h
deleted file mode 100644 (file)
index e2fc34b..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-
-/*
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) INRIA - Sylvestre LEDRU
- *
- * This file must be used under the terms of the CeCILL.
- * This source file is licensed as described in the file COPYING, which
- * you should have received as part of this distribution.  The terms
- * are also available at
- * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
- *
- */
-
-/*--------------------------------------------------------------------------*/
-#ifndef __MGETI_H__
-#define __MGETI_H__
-
-#include "machine.h"
-#include "dynlib_fileio.h"
-/**
- * <long-description>
- *
- * @param char type[]
- * @param fd
- * @return <ReturnValue>
- */
-int SWAP(char type[], int *fd);
-
-/**
- * <long-description>
- *
- * @param fd
- * @param res
- * @param n
- * @param char type[]
- * @param ierr
- */
-FILEIO_IMPEXP void C2F(mgeti) (int *fd, long long *res, int *n, char type[], int *ierr);
-
-#endif /* __MGETI_H__ */
-
diff --git a/scilab/modules/fileio/src/c/mputi.c b/scilab/modules/fileio/src/c/mputi.c
deleted file mode 100644 (file)
index 9ffd8ee..0000000
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
-* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-* Copyright (C) INRIA -
-*
-* This file must be used under the terms of the CeCILL.
-* This source file is licensed as described in the file COPYING, which
-* you should have received as part of this distribution.  The terms
-* are also available at
-* http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
-*
-*/
-
-#include <string.h>
-
-#include "mputi.h"
-#include "sciprint.h"
-#include "filesmanagement.h"
-#include "localization.h"
-#include "islittleendian.h"
-#include "convert_tools.h"
-
-
-void C2F(mputi)(int* _pF, long long* _pVal, int* _iSize, char* _iOpt, int* _iErr)
-{
-    int iType = 0;
-    int iUnsigned = 0;
-    int iEndian = 0;
-
-    int iTypeLen = (int)strlen(_iOpt);
-    int i;
-    FILE *fa = NULL;
-
-    unsigned char *RES_uc   = (unsigned char*)_pVal;
-    unsigned short *RES_us  = (unsigned short*)_pVal;
-    unsigned int *RES_ui    = (unsigned int*)_pVal;
-
-    fa = GetFileOpenedInScilab(*_pF);
-    if (fa == NULL)
-    {
-        sciprint(_("%s: No input file.\n"), "mputi");
-        *_iErr = 1;
-        return;
-    }
-
-    if (iTypeLen == 1)
-    {
-        //type only
-        iUnsigned = SIGNED;
-        iType = checkType(_iOpt[0]);
-    }
-    else if (iTypeLen == 2)
-    {
-        if (_iOpt[0] == 'u')
-        {
-            //unsigned + type
-            iUnsigned = UNSIGNED;
-            iType = checkType(_iOpt[1]);
-        }
-        else
-        {
-            //type + endian
-            iUnsigned = SIGNED;
-            iType = checkType(_iOpt[0]);
-            iEndian = checkEndian(_iOpt[1]);
-        }
-    }
-    else if (iTypeLen == 3)
-    {
-        if (_iOpt[0] == 'u')
-        {
-            //unsigned + type
-            iUnsigned = UNSIGNED;
-            iType = checkType(_iOpt[1]);
-            iEndian = checkEndian(_iOpt[2]);
-        }
-    }
-
-    if (iEndian == 0)
-    {
-        //endian can be setting up by mopen call with flag swap
-        if (GetSwapStatus(*_pF))
-        {
-            iEndian = islittleendian() ? BIG_ENDIAN : LITTLE_ENDIAN;
-        }
-        else
-        {
-            iEndian = islittleendian() ? LITTLE_ENDIAN : BIG_ENDIAN;
-        }
-    }
-    else
-    {
-        if (iEndian == LITTLE_ENDIAN)
-        {
-            iEndian = islittleendian() ? LITTLE_ENDIAN : BIG_ENDIAN;
-        }
-        else
-        {
-            iEndian = islittleendian() ? BIG_ENDIAN : LITTLE_ENDIAN;
-        }
-    }
-
-    if (iType == 0 || iEndian == 0 || iUnsigned == 0)
-    {
-        sciprint(_("%s: %s format not recognized.\n"), "mputi", _iOpt);
-        *_iErr = 1;
-        return;
-    }
-
-    switch (iType)
-    {
-        case TYPE_LONG_LONG :
-            for (i = 0; i < *_iSize ; i++)
-            {
-                unsigned long long val;
-                val = *(_pVal + i);
-                *_iErr = writeLongLong(val, fa, iEndian);
-            }
-            break;
-        case TYPE_INT :
-            for (i = 0; i < *_iSize ; i++)
-            {
-                unsigned int val;
-                val = *(RES_ui + i);
-                *_iErr = writeInt(val, fa, iEndian);
-            }
-            break;
-        case TYPE_SHORT :
-            for (i = 0; i < *_iSize ; i++)
-            {
-                unsigned short val;
-                val = *(RES_us + i);
-                *_iErr = writeShort(val, fa, iEndian);
-            }
-            break;
-        case TYPE_CHAR:
-            for (i = 0; i < *_iSize ; i++)
-            {
-                unsigned char val;
-                val = *(RES_uc + i);
-                *_iErr = writeChar(val, fa, iEndian);
-            }
-            break;
-    }
-}
diff --git a/scilab/modules/fileio/src/c/mputi.h b/scilab/modules/fileio/src/c/mputi.h
deleted file mode 100644 (file)
index de19dc8..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-
-/*
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) INRIA - Sylvestre LEDRU
- *
- * This file must be used under the terms of the CeCILL.
- * This source file is licensed as described in the file COPYING, which
- * you should have received as part of this distribution.  The terms
- * are also available at
- * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
- *
- */
-
-/*--------------------------------------------------------------------------*/
-#ifndef __MPUTI_H__
-#define __MPUTI_H__
-
-#include "dynlib_fileio.h"
-#include "machine.h"
-
-/**
- * TODO: add comment
- *
- * @param fd
- * @param res
- * @param n
- * @param char type[]
- * @param ierr
- */
-FILEIO_IMPEXP void C2F(mputi) (int *fd, long long *res, int *n, char type[], int *ierr);
-
-#endif /* __MPUTI_H__ */
-
index ee7068f..79b74f5 100644 (file)
@@ -16,7 +16,6 @@
 extern "C"
 {
 #include "addfile.h"
-#include "filesmanagement.h"
 #include "charEncoding.h"
 #include "sci_malloc.h"
 }
diff --git a/scilab/modules/fileio/src/cpp/filemanager_interface.cpp b/scilab/modules/fileio/src/cpp/filemanager_interface.cpp
new file mode 100644 (file)
index 0000000..409cc5f
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+*  Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+*  Copyright (C) 2015 - Scilab Enterprises - Antoine ELIAS
+*
+*  This file must be used under the terms of the CeCILL.
+*  This source file is licensed as described in the file COPYING, which
+*  you should have received as part of this distribution.  The terms
+*  are also available at
+*  http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+*
+*/
+
+#include "filemanager.hxx"
+
+#include "filemanager_interface.h"
+
+FILEIO_IMPEXP const wchar_t* getfile_filename(int uid)
+{
+    types::File* file = FileManager::getFile(uid);
+    if (file == nullptr)
+    {
+        return nullptr;
+    }
+
+    return file->getFilename().data();
+}
index 4461ae0..24bc266 100644 (file)
@@ -16,7 +16,6 @@
 extern "C"
 {
 #include "mclose.h"
-#include "filesmanagement.h"
 #include "delfile.h"
 #include "core_math.h" /* Min Max */
 #include "sciprint.h"
index f7c8646..8deabe2 100644 (file)
@@ -23,7 +23,6 @@ extern "C"
 #define uint32_t unsigned long
 #endif
 #include "mget.h"
-#include "filesmanagement.h"
 #include "sciprint.h"
 #include "islittleendian.h"
 #include "convert_tools.h"
index a906006..7125aab 100644 (file)
@@ -20,7 +20,6 @@ extern "C"
 #include <Windows.h>
 #endif
 #include "mgetl.h"
-#include "filesmanagement.h"
 #include "mopen.h"
 #include "sci_malloc.h"
 #include "os_string.h"
index 17e4bb2..4dd13b5 100644 (file)
@@ -16,7 +16,6 @@
 extern "C"
 {
 #include "mgetstr.h"
-#include "filesmanagement.h"
 #include "sci_malloc.h"
 #include "charEncoding.h"
 }
index 006a499..606e5f5 100644 (file)
@@ -22,7 +22,6 @@ extern "C"
 #define uint32_t unsigned long
 #endif
 #include "mput.h"
-#include "filesmanagement.h"
 #include "sciprint.h"
 #include "islittleendian.h"
 #include "convert_tools.h"
@@ -69,76 +68,6 @@ extern "C"
       *ierr=1;return;                                                  \
     }
 /*--------------------------------------------------------------------------*/
-/* write data without convertion (res is supposed to have type type) */
-void C2F(mputnc) (int *fd, void * res, int *n1, char *type, int *ierr)
-{
-    char c1, c2;
-    int i, n;
-    FILE *fa;
-    n = *n1;
-    *ierr = 0;
-    if ((fa = GetFileOpenedInScilab(*fd)) == NULL)
-    {
-        if ( getWarningMode() )
-        {
-            sciprint(_("%s: No input file associated to logical unit %d.\n"), "mput", *fd);
-        }
-        *ierr = 3;
-        return;
-    }
-    int swap = GetSwapStatus(*fd);
-
-    c1 = ( strlen(type) > 1) ? type[1] : ' ';
-    c2 = ( strlen(type) > 2) ? type[2] : ' ';
-    switch ( type[0] )
-    {
-        case 'i' :
-            MPUT_GEN_NC(int, c1);
-            break;
-        case 'l' :
-            MPUT_GEN_NC(long long, c1);
-            break;
-        case 's' :
-            MPUT_GEN_NC(short, c1);
-            break;
-        case 'c' :
-            MPUT_CHAR_NC(char) ;
-            break;
-        case 'd' :
-            MPUT_GEN_NC(double, c1);
-            break;
-        case 'f' :
-            MPUT_GEN_NC(float, c1);
-            break;
-        case 'u' :
-            switch ( c1 )
-            {
-                case 'i' :
-                    MPUT_GEN_NC(unsigned int, c2);
-                    break;
-                case 'l' :
-                    MPUT_GEN_NC(unsigned long long, c2);
-                    break;
-                case 's' :
-                    MPUT_GEN_NC(unsigned short, c2);
-                    break;
-                case ' ' :
-                    MPUT_GEN_NC(unsigned int, ' ');
-                    break;
-                case 'c' :
-                    MPUT_CHAR_NC(unsigned char);
-                    break;
-                default :
-                    *ierr = 1;
-                    return ;
-            }
-            break;
-        default :
-            *ierr = 1;
-            break;
-    }
-}
-/*--------------------------------------------------------------------------*/
 /*================================================
  * function to write data stored in double
  *================================================*/
index 314c429..5cf0312 100644 (file)
@@ -19,7 +19,6 @@ extern "C"
 #include <errno.h>
 #include "mseek.h"
 #include "sciprint.h"
-#include "filesmanagement.h"
 #include "localization.h"
 #include "charEncoding.h"
 #include "sci_malloc.h"
index d0f19a7..3858552 100644 (file)
@@ -17,7 +17,6 @@ extern "C"
 {
 #include <stdio.h>
 #include "mtell.h"
-#include "filesmanagement.h"
 #include "localization.h"
 #include "sci_malloc.h"
 }