mput & mget 31/1431/3
antoine ELIAS [Mon, 26 Jul 2010 09:23:07 +0000 (11:23 +0200)]
Change-Id: I953004bf23fb36a57f3fe36138ef8f6ab4fbabaf

21 files changed:
scilab/Scilab.sln
scilab/modules/fileio/Makefile.am
scilab/modules/fileio/Makefile.in
scilab/modules/fileio/fileio.vcproj
scilab/modules/fileio/includes/fileio_gw.hxx
scilab/modules/fileio/includes/gw_fileio.h
scilab/modules/fileio/sci_gateway/c/gw_fileio.c
scilab/modules/fileio/sci_gateway/c/sci_mget.c [deleted file]
scilab/modules/fileio/sci_gateway/c/sci_mput.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_mclose.cpp
scilab/modules/fileio/sci_gateway/cpp/sci_mget.cpp [new file with mode: 0644]
scilab/modules/fileio/sci_gateway/cpp/sci_mopen.cpp
scilab/modules/fileio/sci_gateway/cpp/sci_mput.cpp [new file with mode: 0644]
scilab/modules/fileio/src/cpp/filemanager.cpp
scilab/modules/fileio/src/cpp/mclose.cpp
scilab/modules/fileio/src/cpp/mget.cpp [moved from scilab/modules/fileio/src/c/mget.c with 87% similarity]
scilab/modules/fileio/src/cpp/mput.cpp [moved from scilab/modules/fileio/src/c/mput.c with 83% similarity]
scilab/modules/types/includes/file.hxx
scilab/modules/types/src/cpp/file.cpp

index 585db09..d25437f 100644 (file)
@@ -1460,6 +1460,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fileio_gw", "modules\fileio
                {2C60033B-0DBD-4CA4-80D3-176C9BE9CE2F} = {2C60033B-0DBD-4CA4-80D3-176C9BE9CE2F}
                {4FC72D4A-80EE-4B1A-8724-0201C1A35621} = {4FC72D4A-80EE-4B1A-8724-0201C1A35621}
                {0D3FA25B-8116-44EC-A45E-260789DAA3D9} = {0D3FA25B-8116-44EC-A45E-260789DAA3D9}
+               {8028F371-6A94-4A26-8804-6E7F05F1D1AA} = {8028F371-6A94-4A26-8804-6E7F05F1D1AA}
                {43C5BAB1-1DCA-4743-A183-77E0D42FE7D0} = {43C5BAB1-1DCA-4743-A183-77E0D42FE7D0}
                {A5911CD7-F8E8-440C-A23E-4843A0636F3A} = {A5911CD7-F8E8-440C-A23E-4843A0636F3A}
                {64E090DA-DCB5-4F4D-93D7-E88DDEC9C2EF} = {64E090DA-DCB5-4F4D-93D7-E88DDEC9C2EF}
index f0628a1..ab18981 100644 (file)
@@ -18,11 +18,9 @@ src/c/getfiletype.c \
 src/c/mclearerr.c \
 src/c/meof.c \
 src/c/merror.c \
-src/c/mget.c \
 src/c/mgetl.c \
 src/c/mgeti.c \
 src/c/mgetstr.c \
-src/c/mput.c \
 src/c/mputi.c \
 src/c/mputstr.c \
 src/c/mseek.c \
@@ -76,11 +74,9 @@ 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_mget.c \
 sci_gateway/c/sci_mgetl.c \
 sci_gateway/c/sci_mgetstr.c \
 sci_gateway/c/sci_moef.c \
-sci_gateway/c/sci_mput.c \
 sci_gateway/c/sci_mputstr.c \
 sci_gateway/c/sci_mseek.c \
 sci_gateway/c/sci_mtell.c \
@@ -98,12 +94,16 @@ 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_mclose.cpp \
+       sci_gateway/cpp/sci_mget.cpp \
+       sci_gateway/cpp/sci_mput.cpp
 
 FILEIO_CPP_SOURCES = \
        src/cpp/expandPathVariable.cpp \
        src/cpp/mopen.cpp \
        src/cpp/mclose.cpp \
+       src/cpp/mput.cpp \
+       src/cpp/mget.cpp \
        src/cpp/filemanager.cpp
 
 
index 3523e27..8ebca31 100644 (file)
@@ -125,9 +125,8 @@ 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-mget.lo libscifileio_la-mgetl.lo \
-       libscifileio_la-mgeti.lo libscifileio_la-mgetstr.lo \
-       libscifileio_la-mput.lo libscifileio_la-mputi.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 \
@@ -147,6 +146,7 @@ am__objects_1 = libscifileio_la-FileExist.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-filemanager.lo
 am__objects_3 = libscifileio_la-gw_fileio.lo \
        libscifileio_la-sci_mfprintf.lo libscifileio_la-sci_mscanf.lo \
@@ -165,9 +165,8 @@ 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_mget.lo \
-       libscifileio_la-sci_mgetl.lo libscifileio_la-sci_mgetstr.lo \
-       libscifileio_la-sci_moef.lo libscifileio_la-sci_mput.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 \
@@ -180,7 +179,8 @@ am__objects_3 = libscifileio_la-gw_fileio.lo \
        libscifileio_la-sci_pathconvert.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_mopen.lo libscifileio_la-sci_mclose.lo \
+       libscifileio_la-sci_mget.lo libscifileio_la-sci_mput.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,11 +480,9 @@ src/c/getfiletype.c \
 src/c/mclearerr.c \
 src/c/meof.c \
 src/c/merror.c \
-src/c/mget.c \
 src/c/mgetl.c \
 src/c/mgeti.c \
 src/c/mgetstr.c \
-src/c/mput.c \
 src/c/mputi.c \
 src/c/mputstr.c \
 src/c/mseek.c \
@@ -538,11 +536,9 @@ 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_mget.c \
 sci_gateway/c/sci_mgetl.c \
 sci_gateway/c/sci_mgetstr.c \
 sci_gateway/c/sci_moef.c \
-sci_gateway/c/sci_mput.c \
 sci_gateway/c/sci_mputstr.c \
 sci_gateway/c/sci_mseek.c \
 sci_gateway/c/sci_mtell.c \
@@ -560,12 +556,16 @@ 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_mclose.cpp \
+       sci_gateway/cpp/sci_mget.cpp \
+       sci_gateway/cpp/sci_mput.cpp
 
 FILEIO_CPP_SOURCES = \
        src/cpp/expandPathVariable.cpp \
        src/cpp/mopen.cpp \
        src/cpp/mclose.cpp \
+       src/cpp/mput.cpp \
+       src/cpp/mget.cpp \
        src/cpp/filemanager.cpp
 
 libscifileio_la_CPPFLAGS = -I$(srcdir)/includes/ \
@@ -976,13 +976,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-mget.lo: src/c/mget.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-mget.lo -MD -MP -MF $(DEPDIR)/libscifileio_la-mget.Tpo -c -o libscifileio_la-mget.lo `test -f 'src/c/mget.c' || echo '$(srcdir)/'`src/c/mget.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscifileio_la-mget.Tpo $(DEPDIR)/libscifileio_la-mget.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/mget.c' object='libscifileio_la-mget.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-mget.lo `test -f 'src/c/mget.c' || echo '$(srcdir)/'`src/c/mget.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
@@ -1004,13 +997,6 @@ libscifileio_la-mgetstr.lo: src/c/mgetstr.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-mgetstr.lo `test -f 'src/c/mgetstr.c' || echo '$(srcdir)/'`src/c/mgetstr.c
 
-libscifileio_la-mput.lo: src/c/mput.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-mput.lo -MD -MP -MF $(DEPDIR)/libscifileio_la-mput.Tpo -c -o libscifileio_la-mput.lo `test -f 'src/c/mput.c' || echo '$(srcdir)/'`src/c/mput.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscifileio_la-mput.Tpo $(DEPDIR)/libscifileio_la-mput.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/mput.c' object='libscifileio_la-mput.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-mput.lo `test -f 'src/c/mput.c' || echo '$(srcdir)/'`src/c/mput.c
-
 libscifileio_la-mputi.lo: src/c/mputi.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-mputi.lo -MD -MP -MF $(DEPDIR)/libscifileio_la-mputi.Tpo -c -o libscifileio_la-mputi.lo `test -f 'src/c/mputi.c' || echo '$(srcdir)/'`src/c/mputi.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscifileio_la-mputi.Tpo $(DEPDIR)/libscifileio_la-mputi.Plo
@@ -1368,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_mget.lo: sci_gateway/c/sci_mget.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_mget.lo -MD -MP -MF $(DEPDIR)/libscifileio_la-sci_mget.Tpo -c -o libscifileio_la-sci_mget.lo `test -f 'sci_gateway/c/sci_mget.c' || echo '$(srcdir)/'`sci_gateway/c/sci_mget.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscifileio_la-sci_mget.Tpo $(DEPDIR)/libscifileio_la-sci_mget.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/sci_mget.c' object='libscifileio_la-sci_mget.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_mget.lo `test -f 'sci_gateway/c/sci_mget.c' || echo '$(srcdir)/'`sci_gateway/c/sci_mget.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
@@ -1396,13 +1375,6 @@ libscifileio_la-sci_moef.lo: sci_gateway/c/sci_moef.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_moef.lo `test -f 'sci_gateway/c/sci_moef.c' || echo '$(srcdir)/'`sci_gateway/c/sci_moef.c
 
-libscifileio_la-sci_mput.lo: sci_gateway/c/sci_mput.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_mput.lo -MD -MP -MF $(DEPDIR)/libscifileio_la-sci_mput.Tpo -c -o libscifileio_la-sci_mput.lo `test -f 'sci_gateway/c/sci_mput.c' || echo '$(srcdir)/'`sci_gateway/c/sci_mput.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscifileio_la-sci_mput.Tpo $(DEPDIR)/libscifileio_la-sci_mput.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/sci_mput.c' object='libscifileio_la-sci_mput.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_mput.lo `test -f 'sci_gateway/c/sci_mput.c' || echo '$(srcdir)/'`sci_gateway/c/sci_mput.c
-
 libscifileio_la-sci_mputstr.lo: sci_gateway/c/sci_mputstr.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_mputstr.lo -MD -MP -MF $(DEPDIR)/libscifileio_la-sci_mputstr.Tpo -c -o libscifileio_la-sci_mputstr.lo `test -f 'sci_gateway/c/sci_mputstr.c' || echo '$(srcdir)/'`sci_gateway/c/sci_mputstr.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscifileio_la-sci_mputstr.Tpo $(DEPDIR)/libscifileio_la-sci_mputstr.Plo
@@ -1536,6 +1508,20 @@ libscifileio_la-mclose.lo: src/cpp/mclose.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-mclose.lo `test -f 'src/cpp/mclose.cpp' || echo '$(srcdir)/'`src/cpp/mclose.cpp
 
+libscifileio_la-mput.lo: src/cpp/mput.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-mput.lo -MD -MP -MF $(DEPDIR)/libscifileio_la-mput.Tpo -c -o libscifileio_la-mput.lo `test -f 'src/cpp/mput.cpp' || echo '$(srcdir)/'`src/cpp/mput.cpp
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscifileio_la-mput.Tpo $(DEPDIR)/libscifileio_la-mput.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='src/cpp/mput.cpp' object='libscifileio_la-mput.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-mput.lo `test -f 'src/cpp/mput.cpp' || echo '$(srcdir)/'`src/cpp/mput.cpp
+
+libscifileio_la-mget.lo: src/cpp/mget.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-mget.lo -MD -MP -MF $(DEPDIR)/libscifileio_la-mget.Tpo -c -o libscifileio_la-mget.lo `test -f 'src/cpp/mget.cpp' || echo '$(srcdir)/'`src/cpp/mget.cpp
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscifileio_la-mget.Tpo $(DEPDIR)/libscifileio_la-mget.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='src/cpp/mget.cpp' object='libscifileio_la-mget.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-mget.lo `test -f 'src/cpp/mget.cpp' || echo '$(srcdir)/'`src/cpp/mget.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
@@ -1564,6 +1550,20 @@ libscifileio_la-sci_mclose.lo: sci_gateway/cpp/sci_mclose.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_mclose.lo `test -f 'sci_gateway/cpp/sci_mclose.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_mclose.cpp
 
+libscifileio_la-sci_mget.lo: sci_gateway/cpp/sci_mget.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_mget.lo -MD -MP -MF $(DEPDIR)/libscifileio_la-sci_mget.Tpo -c -o libscifileio_la-sci_mget.lo `test -f 'sci_gateway/cpp/sci_mget.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_mget.cpp
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscifileio_la-sci_mget.Tpo $(DEPDIR)/libscifileio_la-sci_mget.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='sci_gateway/cpp/sci_mget.cpp' object='libscifileio_la-sci_mget.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_mget.lo `test -f 'sci_gateway/cpp/sci_mget.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_mget.cpp
+
+libscifileio_la-sci_mput.lo: sci_gateway/cpp/sci_mput.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_mput.lo -MD -MP -MF $(DEPDIR)/libscifileio_la-sci_mput.Tpo -c -o libscifileio_la-sci_mput.lo `test -f 'sci_gateway/cpp/sci_mput.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_mput.cpp
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscifileio_la-sci_mput.Tpo $(DEPDIR)/libscifileio_la-sci_mput.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='sci_gateway/cpp/sci_mput.cpp' object='libscifileio_la-sci_mput.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_mput.lo `test -f 'sci_gateway/cpp/sci_mput.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_mput.cpp
+
 mostlyclean-libtool:
        -rm -f *.lo
 
index ed1d713..714560c 100644 (file)
                                >
                        </File>
                        <File
-                               RelativePath=".\src\c\mget.c"
+                               RelativePath=".\src\cpp\mget.cpp"
                                >
                        </File>
                        <File
                                >
                        </File>
                        <File
-                               RelativePath=".\src\c\mput.c"
+                               RelativePath=".\src\cpp\mput.cpp"
                                >
                        </File>
                        <File
                                >
                        </File>
                        <File
-                               RelativePath=".\sci_gateway\c\sci_mget.c"
-                               >
-                       </File>
-                       <File
                                RelativePath=".\sci_gateway\c\sci_mgetl.c"
                                >
                        </File>
                                >
                        </File>
                        <File
-                               RelativePath=".\sci_gateway\c\sci_mput.c"
-                               >
-                       </File>
-                       <File
                                RelativePath=".\sci_gateway\c\sci_mputstr.c"
                                >
                        </File>
index 1200e68..f42a381 100644 (file)
@@ -38,5 +38,7 @@ public :
 
 CPP_GATEWAY_PROTOTYPE(sci_mopen);
 CPP_GATEWAY_PROTOTYPE(sci_mclose);
+CPP_GATEWAY_PROTOTYPE(sci_mput);
+CPP_GATEWAY_PROTOTYPE(sci_mget);
 
 #endif /* !__FILEIO_GW_HXX__ */
index 6a890a6..9cf5b20 100644 (file)
 FILEIO_IMPEXP int gw_fileio(void);
 /*--------------------------------------------------------------------------*/ 
 FILEIO_IMPEXP int sci_meof(char *fname,unsigned long fname_len);
-FILEIO_IMPEXP int sci_mopen(char *fname,unsigned long fname_len);
-FILEIO_IMPEXP int sci_mclose(char *fname,unsigned long fname_len);
+//FILEIO_IMPEXP int sci_mopen(char *fname,unsigned long fname_len);
+//FILEIO_IMPEXP int sci_mclose(char *fname,unsigned long fname_len);
 FILEIO_IMPEXP int sci_merror(char *fname,unsigned long fname_len);
 FILEIO_IMPEXP int sci_mputstr(char *fname,unsigned long fname_len);
-FILEIO_IMPEXP int sci_mput(char *fname,unsigned long fname_len);
-FILEIO_IMPEXP int sci_mget(char *fname,unsigned long fname_len);
+//FILEIO_IMPEXP int sci_mput(char *fname,unsigned long fname_len);
+//FILEIO_IMPEXP int sci_mget(char *fname,unsigned long fname_len);
 FILEIO_IMPEXP int sci_mgetstr(char *fname,unsigned long fname_len);
 FILEIO_IMPEXP int sci_mseek(char *fname,unsigned long fname_len);
 FILEIO_IMPEXP int sci_mtell(char *fname,unsigned long fname_len);
index 074cd60..015157e 100644 (file)
@@ -22,8 +22,8 @@ static gw_generic_table Tab[]={
        {NULL, ""}, //mopen
        {sci_mputstr, "mputstr"},
        {NULL, ""}, //mclose
-       {sci_mput, "mput"},
-       {sci_mget, "mget"},
+       {NULL, ""}, //mput
+       {NULL, ""}, //mget
        {sci_mgetstr, "mgetstr"},
        {sci_meof, "meof"},
        {sci_mseek, "mseek"},
diff --git a/scilab/modules/fileio/sci_gateway/c/sci_mget.c b/scilab/modules/fileio/sci_gateway/c/sci_mget.c
deleted file mode 100644 (file)
index 2181bd1..0000000
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
-* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-* Copyright (C) 2006 - INRIA - Allan CORNET
-* Copyright (C) 2009 - DIGITEO - Allan CORNET
-* ...
-* 
-* This file must be used under the terms of the CeCILL.
-* This source file is licensed as described in the file COPYING, which
-* you should have received as part of this distribution.  The terms
-* are also available at    
-* http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
-*
-*/
-/*--------------------------------------------------------------------------*/
-#include "stack-c.h"
-#include "gw_fileio.h"
-#include "MALLOC.h"
-#include "mget.h"
-#include "localization.h"
-#include "Scierror.h"
-/*--------------------------------------------------------------------------*/
-#define ALL_FILES_DESCRIPTOR -1
-/*--------------------------------------------------------------------------*/
-int sci_mget(char *fname,unsigned long fname_len)
-{
-       int m1 = 0, n1 = 0, l1 = 0;
-       int m2 = 0, n2 = 0, l2 = 0;
-       int     m3 = 0, n3 = 0, l3 = 0;
-       int l4 = 0;
-       int err = 0;
-       char *type = NULL;
-       int fd = ALL_FILES_DESCRIPTOR;
-       int n = 1;
-       int one = 1;
-
-       Nbvars = 0;
-       CheckRhs(1,3);
-       CheckLhs(1,1);
-
-       if ( Rhs >= 1)
-       {
-               if (GetType(1) == sci_matrix)
-               {
-                       GetRhsVar(1,MATRIX_OF_INTEGER_DATATYPE,&m1,&n1,&l1);
-                       if (m1*n1 == 1)
-                       {
-                               n  = *istk(l1);
-                       }
-                       else
-                       {
-                               Scierror(999, _("%s: Wrong size for input argument #%d: A integer expected.\n"), fname,1);
-                               return 0;
-                       }
-               }
-               else
-               {
-                       Scierror(999, _("%s: Wrong type for input argument #%d: A integer expected.\n"), fname,1);
-                       return 0;
-               }
-       }
-
-       if ( Rhs >= 2)
-       {
-               if (GetType(2) == sci_strings)
-               {
-                       GetRhsVar(2,STRING_DATATYPE,&m2,&n2,&l2);
-                       type = cstk(l2);
-               }
-               else
-               {
-                       Scierror(999, _("%s: Wrong type for input argument #%d: A string expected.\n"), fname,2);
-                       return 0;
-               }
-       }
-       else
-       {
-               type = LIST_DATATYPE;
-       }
-
-       if ( Rhs >= 3)
-       {
-               if (GetType(3) == sci_matrix)
-               {
-                       GetRhsVar(3,MATRIX_OF_INTEGER_DATATYPE,&m3,&n3,&l3);
-                       if (m3*n3 == 1)
-                       {
-                               fd = *istk(l3);
-                       }
-                       else
-                       {
-                               Scierror(999, _("%s: Wrong size for input argument #%d: A integer expected.\n"), fname,3);
-                               return 0;
-                       }
-               }
-               else
-               {
-                       Scierror(999, _("%s: Wrong type for input argument #%d: A integer expected.\n"), fname,3);
-                       return 0;
-               }
-       }
-
-       CreateVar(Rhs+1,MATRIX_OF_DOUBLE_DATATYPE,&one,&n,&l4);
-       LhsVar(1) = Rhs+1;
-
-       C2F(mget)(&fd,stk(l4),&n,type,&err);
-
-       if (err >  0)
-       {
-               SciError(10000);
-               return 0;
-       }
-       else if ( err < 0)
-       {
-               int n5 = 0, l5 = 0, i = 0;
-               /* n contains now the effectively read data */
-               n5 = -err -1;
-               if ( n5 < n )
-               {
-                       CreateVar(Rhs+2, MATRIX_OF_DOUBLE_DATATYPE, &one, &n5, &l5);
-
-                       for ( i = 0; i < n5 ; i++) 
-                       {
-                               *stk(l5+i) = *stk(l4+i);
-                       }
-
-                       LhsVar(1) = Rhs + 2;
-               }
-       }
-
-       PutLhsVar();
-
-       return 0;
-}
-/*--------------------------------------------------------------------------*/
diff --git a/scilab/modules/fileio/sci_gateway/c/sci_mput.c b/scilab/modules/fileio/sci_gateway/c/sci_mput.c
deleted file mode 100644 (file)
index d4b9a8f..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
-* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-* Copyright (C) 2006 - INRIA - Allan CORNET
-* Copyright (C) 2009 - DIGITEO - Allan CORNET
-* 
-* This file must be used under the terms of the CeCILL.
-* This source file is licensed as described in the file COPYING, which
-* you should have received as part of this distribution.  The terms
-* are also available at    
-* http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
-*
-*/
-/*--------------------------------------------------------------------------*/
-#include "stack-c.h"
-#include "gw_fileio.h"
-#include "MALLOC.h"
-#include "mput.h"
-#include "localization.h"
-#include "Scierror.h"
-/*--------------------------------------------------------------------------*/
-#define ALL_FILES_DESCRIPTOR -1
-/*--------------------------------------------------------------------------*/
-int sci_mput(char *fname,unsigned long fname_len)
-{
-       int m1 = 0, n1 = 0, l1 = 0;
-       int m2 = 0, n2 = 0, l2 = 0;
-       int m3 = 0, n3 = 0, l3 = 0;
-       int err = 0;
-       char *type = NULL;
-       int fd = ALL_FILES_DESCRIPTOR;
-
-       Nbvars = 0;
-       CheckRhs(1,3);
-       CheckLhs(1,1);
-
-       /*  checking variable res */
-       if ( (GetType(1) == sci_matrix) || (GetType(1) == sci_ints) )
-       {
-               GetRhsVar(1,MATRIX_OF_DOUBLE_DATATYPE,&m1,&n1,&l1);
-       }
-       else
-       {
-               Scierror(999, _("%s: Wrong type for input argument #%d: A integer expected.\n"), fname,1);
-               return 0;
-       }
-       
-       n1 = m1*n1;
-
-       if ( Rhs >= 2)
-       {
-               if (GetType(2) == sci_strings)
-               {
-                       GetRhsVar(2,STRING_DATATYPE,&m2,&n2,&l2);
-                       type = cstk(l2);
-               }
-               else
-               {
-                       Scierror(999, _("%s: Wrong type for input argument #%d: A string expected.\n"), fname,2);
-                       return 0;
-               }
-       }
-       else
-       {
-               type = LIST_DATATYPE;
-       }
-
-       if ( Rhs >= 3)
-       {
-               if (GetType(3) == sci_matrix)
-               {
-                       GetRhsVar(3,MATRIX_OF_INTEGER_DATATYPE,&m3,&n3,&l3);
-                       if (m3*n3 == 1)
-                       {
-                               fd = *istk(l3);
-                       }
-                       else
-                       {
-                               Scierror(999, _("%s: Wrong size for input argument #%d: A integer expected.\n"), fname,2);
-                               return 0;
-                       }
-               }
-               else
-               {
-                       Scierror(999, _("%s: Wrong type for input argument #%d: A integer expected.\n"), fname,2);
-                       return 0;
-               }
-       }
-
-       C2F(mput)(&fd,stk(l1),&n1,type,&err);
-
-       if (err >  0)
-       {
-               SciError(10000);
-               return 0;
-       }
-
-       LhsVar(1) = 0;
-       PutLhsVar();
-
-       return 0;
-}
-/*--------------------------------------------------------------------------*/
index 7bbd07d..98503e1 100644 (file)
@@ -27,5 +27,7 @@ bool FileioModule::Load()
     symbol::Context::getInstance()->AddFunction(Function::createFunction(L"pwd", &sci_pwd, MODULE_NAME));
     symbol::Context::getInstance()->AddFunction(Function::createFunction(L"mopen", &sci_mopen, MODULE_NAME));
     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));
     return true;
 }
index 29708dc..b052a54 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"
+                               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"
                                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"
+                               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"
                                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"
+                               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"
                                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"
+                               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"
                                PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;FILEIO_GW_EXPORTS"
                                RuntimeLibrary="2"
                                EnableFunctionLevelLinking="true"
                                >
                        </File>
                        <File
+                               RelativePath=".\sci_mget.cpp"
+                               >
+                       </File>
+                       <File
                                RelativePath=".\sci_mopen.cpp"
                                >
                        </File>
+                       <File
+                               RelativePath=".\sci_mput.cpp"
+                               >
+                       </File>
                </Filter>
                <Filter
                        Name="Header Files"
index 32bef2d..27dcd6f 100644 (file)
@@ -79,93 +79,4 @@ Function::ReturnValue sci_mclose(typed_list &in, int _iRetCount, typed_list &out
     out.push_back(pD);
     return Function::OK;
 }
-
-int sci_mclose(char *fname,unsigned long fname_len)
-{
-       //int m1 = 0,n1 = 0,l1 =0;
-       //int one = 1, l2 = 0;
-       //int fd = ALL_FILES_DESCRIPTOR;
-
-       //Nbvars = 0;
-       //CheckRhs(0,1);
-       //CheckLhs(1,1);
-
-       //if (Rhs == 0)
-       //{
-       //      fd = ALL_FILES_DESCRIPTOR;
-       //      CreateVar(Rhs+1,MATRIX_OF_DOUBLE_DATATYPE, &one, &one, &l2);
-
-       //      C2F(mclose)(&fd,stk(l2));
-
-       //      LhsVar(1) = Rhs+1;
-       //      PutLhsVar();
-       //}
-       //else /* Rhs == 1 */
-       //{
-       //      if (GetType(1) == sci_matrix)
-       //      {
-       //              GetRhsVar(1,MATRIX_OF_INTEGER_DATATYPE,&m1,&n1,&l1);
-       //              if (m1*n1 == 1)
-       //              {
-       //                      fd = *istk(l1);
-       //                      CreateVar(Rhs+1,MATRIX_OF_DOUBLE_DATATYPE, &one, &one, &l2);
-
-       //                      C2F(mclose)(&fd,stk(l2));
-
-       //                      LhsVar(1) = Rhs+1;
-       //                      PutLhsVar();
-       //              }
-       //              else
-       //              {
-       //                      Scierror(999, _("%s: Wrong size for input argument #%d: A integer expected.\n"), fname,1);
-       //              }
-       //      }
-       //      else if (GetType(1) == sci_strings)
-       //      {
-       //              char **input_string = NULL;
-
-       //              GetRhsVar(1 ,MATRIX_OF_STRING_DATATYPE,&m1,&n1,&input_string);
-       //              if (m1*n1 == 1)
-       //              {
-       //                      double err = 0.0;
-
-       //                      if (strcmp(input_string[0],"all") == 0)
-       //                      {
-       //                              fd = ALL_FILES_DESCRIPTOR;
-       //                      }
-       //                      else
-       //                      {
-       //                              fd = GetIdFromFilename(input_string[0]);
-       //                      }
-
-       //                      if ( (fd == FILE_ID_NOT_DEFINED) && getWarningMode() )
-       //                      {
-       //                              sciprint(_("%s: No such file %s.\n"),fname, input_string[0]);
-       //                      }
-       //                      else
-       //                      {
-       //                              C2F(mclose)(&fd,&err);
-       //                      }
-
-       //                      freeArrayOfString(input_string,m1*n1);
-
-       //                      CreateVar(Rhs+1,MATRIX_OF_DOUBLE_DATATYPE, &one, &one, &l2);
-       //                      *stk(l2) = err;
-
-       //                      LhsVar(1) = Rhs+1;
-       //                      PutLhsVar();
-       //              }
-       //              else
-       //              {
-       //                      freeArrayOfString(input_string,m1*n1);
-       //                      Scierror(999, _("%s: Wrong size for input argument #%d: A string expected.\n"), fname,1);
-       //              }
-       //      }
-       //      else
-       //      {
-       //              Scierror(999, _("%s: Wrong type for input argument #%d: A integer or string expected.\n"), fname,1);
-       //      }
-       //}
-       return 0;
-}
 /*--------------------------------------------------------------------------*/
diff --git a/scilab/modules/fileio/sci_gateway/cpp/sci_mget.cpp b/scilab/modules/fileio/sci_gateway/cpp/sci_mget.cpp
new file mode 100644 (file)
index 0000000..108e557
--- /dev/null
@@ -0,0 +1,105 @@
+/*
+* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+* Copyright (C) 2006 - INRIA - Allan CORNET
+* Copyright (C) 2009 - DIGITEO - Allan CORNET
+* ...
+* 
+* This file must be used under the terms of the CeCILL.
+* This source file is licensed as described in the file COPYING, which
+* you should have received as part of this distribution.  The terms
+* are also available at    
+* http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+*
+*/
+/*--------------------------------------------------------------------------*/
+#include "funcmanager.hxx"
+#include "filemanager.hxx"
+#include "fileio_gw.hxx"
+
+extern "C"
+{
+#include "mget.h"
+#include "localization.h"
+#include "Scierror.h"
+#include "charEncoding.h"
+#ifdef _MSC_VER
+#include "strdup_windows.h"
+#endif
+}
+/*--------------------------------------------------------------------------*/
+Function::ReturnValue sci_mget(typed_list &in, int _iRetCount, typed_list &out)
+{
+    char* pstType   = strdup("l");//default type value : long
+    int iSize       = 0;
+    int iFile       = -1; //default file : last opened file
+    double* pData   = NULL;
+    int iErr        = 0;
+
+    if(in.size() < 1 || in.size() > 3)
+    {
+        ScierrorW(77, _W("%ls: Wrong number of input argument(s): %d to %d expected.\n"), L"mget", 1, 3);
+        return Function::Error;
+    }
+
+    //check parameter 1
+    if(in[0]->getType() != InternalType::RealDouble || in[0]->getAsDouble()->size_get() != 1)
+    {
+        ScierrorW(999, _W("%ls: Wrong type for input argument #%d: A integer expected.\n"), L"mget", 1);
+        return Function::Error;
+    }
+
+    iSize = static_cast<int>(in[0]->getAsDouble()->real_get()[0]);
+
+    if(in.size() >= 2)
+    {//export format
+        if(in[1]->getType() != InternalType::RealString || in[1]->getAsString()->size_get() != 1)
+        {
+            ScierrorW(999, _W("%ls: Wrong type for input argument #%d: A string expected.\n"), L"mput", 2);
+            return Function::Error;
+        }
+        pstType = wide_string_to_UTF8(in[1]->getAsString()->string_get(0));
+
+    }
+
+    if(in.size() == 3)
+    {
+        if(in[2]->getType() != InternalType::RealDouble || in[2]->getAsDouble()->size_get() != 1)
+        {
+            ScierrorW(999, _W("%ls: Wrong type for input argument #%d: A integer expected.\n"), L"mput", 3);
+            return Function::Error;
+        }
+
+        iFile = static_cast<int>(in[2]->getAsDouble()->real_get()[0]);
+    }
+
+    Double* pD = new Double(1, iSize);
+    pData = pD->real_get();
+
+    C2F(mget)(&iFile, pData, &iSize, pstType, &iErr);
+
+    File* pFile = FileManager::getFile(iFile);
+    if(iErr > 0)
+    {
+        return Function::Error;
+    }
+
+    if(iErr < 0) //no error
+    {
+        int iNewSize = (-iErr) - 1;
+        if(iNewSize < iSize)
+        {//read data are smaller then excepted size
+            Double* pNewD = new Double(1, iNewSize);
+            double* pNewData = pNewD->real_get();
+            for(int i = 0 ; i < iNewSize ; i++)
+            {
+                pNewData[i] = pData[i];
+            }
+
+            delete pD;
+            pD = pNewD;
+        }
+    }
+    out.push_back(pD);
+    return Function::OK;
+}
+/*--------------------------------------------------------------------------*/
index 305e4f8..90ea163 100644 (file)
@@ -32,7 +32,7 @@ Function::ReturnValue sci_mopen(typed_list &in, int _iRetCount, typed_list &out)
     int iID                 = 0;
     wchar_t* pstFilename    = NULL;
     wchar_t* pstMode        = L"wb";
-    int iSwap               = 1;
+    int iSwap               = 0;
 
     //check input parameters
     if(in.size() >= 1)
@@ -108,38 +108,39 @@ Function::ReturnValue sci_mopen(typed_list &in, int _iRetCount, typed_list &out)
 
     iErr = mopen(pstFilename, pstMode, iSwap, &iID);
 
-    
+
     if(iErr != MOPEN_NO_ERROR)
     {//mange file open errors
         if(_iRetCount == 1)
         {
             switch(iErr)
             {
-                               case MOPEN_CAN_NOT_OPEN_FILE:
-                               {
-                                       ScierrorW(999, _W("%ls: Cannot open file %ls.\n"), L"mopen", pstFilename);
-                                       FREE(pstFilename);
-                                       pstFilename = NULL;
+            case MOPEN_CAN_NOT_OPEN_FILE:
+                {
+                    ScierrorW(999, _W("%ls: Cannot open file %ls.\n"), L"mopen", pstFilename);
+                    FREE(pstFilename);
+                    pstFilename = NULL;
                     return Function::Error;
-                               }
-                               case MOPEN_INVALID_FILENAME:
-                               {
-                                       ScierrorW(999,_W("%ls: invalid filename.\n"), L"mopen");
-                                       FREE(pstFilename);
-                                       pstFilename = NULL;
+                }
+            case MOPEN_INVALID_FILENAME:
+                {
+                    ScierrorW(999,_W("%ls: invalid filename.\n"), L"mopen");
+                    FREE(pstFilename);
+                    pstFilename = NULL;
                     return Function::Error;
-                               }
-                               case MOPEN_INVALID_STATUS:
-                               {
-                                       ScierrorW(999,_W("%ls: invalid status.\n"), L"mopen");
-                                       FREE(pstFilename);
-                                       pstFilename = NULL;
+                }
+            case MOPEN_INVALID_STATUS:
+                {
+                    ScierrorW(999,_W("%ls: invalid status.\n"), L"mopen");
+                    FREE(pstFilename);
+                    pstFilename = NULL;
                     return Function::Error;
-                               }
+                }
             }
         }
     }
 
-    out.push_back(FileManager::getFile(iID));
+    Double* pD = new Double(static_cast<double>(iID));
+    out.push_back(pD);
     return Function::OK;
 }
diff --git a/scilab/modules/fileio/sci_gateway/cpp/sci_mput.cpp b/scilab/modules/fileio/sci_gateway/cpp/sci_mput.cpp
new file mode 100644 (file)
index 0000000..c6e605d
--- /dev/null
@@ -0,0 +1,89 @@
+/*
+* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+* Copyright (C) 2006 - INRIA - Allan CORNET
+* Copyright (C) 2009 - 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
+* 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 "mput.h"
+#include "localization.h"
+#include "Scierror.h"
+#include "charEncoding.h"
+#ifdef _MSC_VER
+#include "strdup_windows.h"
+#endif
+}
+/*--------------------------------------------------------------------------*/
+Function::ReturnValue sci_mput(typed_list &in, int _iRetCount, typed_list &out)
+{
+    char* pstType   = strdup("l");//default type value : long
+    int iSize       = 0;
+    int iFile       = -1; //default file : last opened file
+    double* pData   = NULL;
+    int iErr        = 0;
+
+    if(in.size() < 1 || in.size() > 3)
+    {
+        ScierrorW(77, _W("%ls: Wrong number of input argument(s): %d to %d expected.\n"), L"mput", 1, 3);
+        return Function::Error;
+    }
+
+    //check parameter 1
+    if(in[0]->getType() != InternalType::RealDouble && in[0]->getType() != InternalType::RealInt)
+    {
+        ScierrorW(999, _W("%ls: Wrong type for input argument #%d: A integer expected.\n"), L"mput", 1);
+        return Function::Error;
+    }
+
+    iSize = in[0]->getAsGenericType()->size_get();
+
+    if(in[0]->getType() == InternalType::RealDouble)
+    {
+        pData = in[0]->getAsDouble()->real_get();
+    }
+    else
+    {//ints
+        pData = static_cast<double*>(in[0]->getAsInt()->data_get());
+    }
+
+    if(in.size() >= 2)
+    {//export format
+        if(in[1]->getType() != InternalType::RealString || in[1]->getAsString()->size_get() != 1)
+        {
+            ScierrorW(999, _W("%ls: Wrong type for input argument #%d: A string expected.\n"), L"mput", 2);
+            return Function::Error;
+        }
+        pstType = wide_string_to_UTF8(in[1]->getAsString()->string_get(0));
+
+    }
+
+    if(in.size() == 3)
+    {
+        if(in[2]->getType() != InternalType::RealDouble || in[2]->getAsDouble()->size_get() != 1)
+        {
+            ScierrorW(999, _W("%ls: Wrong type for input argument #%d: A integer expected.\n"), L"mput", 3);
+            return Function::Error;
+        }
+
+        iFile = static_cast<int>(in[2]->getAsDouble()->real_get()[0]);
+    }
+
+    C2F(mput)(&iFile, pData, &iSize, pstType, &iErr);
+
+    FREE(pstType);
+    return Function::OK;
+}
+/*--------------------------------------------------------------------------*/
index 8dd361a..9acf160 100644 (file)
@@ -46,6 +46,11 @@ bool FileManager::isOpened(wstring _stFilename)
 
 types::File* FileManager::getFile(int _iID)
 {
+    if(_iID == -1 && m_iCurrentFile != -1)
+    {
+        return m_fileList[m_iCurrentFile - 1];
+    }
+
     if(_iID <= m_fileList.size())
     {//1-indexed
         return m_fileList[_iID - 1];
@@ -70,16 +75,15 @@ int FileManager::addFile(types::File* _file)
         if(m_fileList[i] == NULL)
         {
             m_fileList[i] = _file;
-            //put ID in "double" part
-            _file->real_get()[0] = i + 1;
-            return i + 1;
+            int iNewId = i + 1;
+            m_iCurrentFile = iNewId;
+            return iNewId;
         }
     }
 
     //no free space, add at the end
     m_fileList.push_back(_file);
     int iNewId = static_cast<int>(m_fileList.size());
-    _file->real_get()[0] = iNewId;
     m_iCurrentFile = iNewId;
     return iNewId;
 }
index d580b9f..2ede96c 100644 (file)
@@ -41,15 +41,6 @@ int mcloseAll()
         }
     }
     
-    //for(int i = 0 ; i < FileManager::getFileMaxID() ; i++)
-    //{
-    //    int iRet = mclose(i+1);
-    //    if(iRet)
-    //    {
-    //        return iRet;
-    //    }
-    //}
-
     return 0;
 }
 
similarity index 87%
rename from scilab/modules/fileio/src/c/mget.c
rename to scilab/modules/fileio/src/cpp/mget.cpp
index 10dfead..e436bec 100644 (file)
  */
 /*--------------------------------------------------------------------------*/
 #include <string.h>
+#include "filemanager.hxx"
+
+extern "C"
+{
 #ifndef _MSC_VER
 #include <stdint.h> 
 #else
@@ -24,9 +28,8 @@
 #include "islittleendian.h"
 #include "../../../libs/libst/misc.h"
 #include "localization.h"
-/*--------------------------------------------------------------------------*/
-struct soundstream ftf;
-int swap = 0;
+#include "charEncoding.h"
+}
 /*--------------------------------------------------------------------------*/
 /* =================================================
 * reads data and store them without type conversion 
@@ -83,7 +86,7 @@ void C2F(mgetnc)(int *fd, void * res, int *n1, char *type, int *ierr)
     *ierr=3;
     return;
   }
-  swap = GetSwapStatus(*fd);
+  int swap = GetSwapStatus(*fd);
   c1 = ( strlen(type) > 1) ? type[1] : ' '; 
   c2 = ( strlen(type) > 2) ? type[2] : ' '; 
   switch ( type[0] )
@@ -133,13 +136,11 @@ void C2F(mgetnc)(int *fd, void * res, int *n1, char *type, int *ierr)
 #define MGET_CHAR(NumType)    MGET_CHAR_NC(NumType);   CONVGD(NumType); 
 /*--------------------------------------------------------------------------*/
 /* reads data and store them in double  */
-void mget2(FILE *fa, int swap2, double *res, int n, char *type, int *ierr)
+void mget2(FILE *fa, int swap, double *res, int n, char *type, int *ierr)
 {  
        char c1,c2;
        int i,items=n;
-       ft_t ft = &ftf; 
        *ierr=0;
-       ft->fp = fa;
        c1 = ( strlen(type) > 1) ? type[1] : ' '; 
        c2 = ( strlen(type) > 2) ? type[2] : ' '; 
        switch ( type[0] )
@@ -175,27 +176,27 @@ void mget2(FILE *fa, int swap2, double *res, int n, char *type, int *ierr)
 /*--------------------------------------------------------------------------*/
 void C2F(mget) (int *fd, double *res, int *n, char *type, int *ierr)
 {  
-  int nc,swap2;
-  FILE *fa;
-  nc=(int)strlen(type);
-  *ierr=0;
-  if ( nc == 0) 
+    *ierr=0;
+    if(strlen(type) == 0) 
     {
-      sciprint(_("%s: Wrong size for input argument #%d: Non-empty string expected.\n"),"mput",4,type);
-      *ierr=2;
-      return;
+        sciprintW(_W("%ls: Wrong size for input argument #%d: Non-empty string expected.\n"), L"mput", 4, type);
+        *ierr=2;
+        return;
     }
-  fa = GetFileOpenedInScilab(*fd);
-  if (fa ) 
+
+    File* pFile = FileManager::getFile(*fd);
+    if(pFile && pFile->getFiledesc()) 
     {
-      swap2 = GetSwapStatus(*fd);
-      mget2(fa,swap2,res,*n,type,ierr);
-      if (*ierr > 0) sciprint(_("%s: Wrong value for input argument #%d: Format not recognized.\n"),"mget",4);
+        mget2(pFile->getFiledesc(), pFile->getFileSwap(), res, *n, type, ierr);
+        if(*ierr > 0)
+        {
+            sciprintW(_W("%ls: Wrong value for input argument #%d: Format not recognized.\n"), L"mget", 4);
+        }
     }
-  else 
+    else 
     {
-      sciprint(_("%s: No input file associated to logical unit %d.\n"),"mget",*fd);
-      *ierr=3;
+        sciprintW(_W("%ls: No input file associated to logical unit %d.\n"), L"mget", *fd);
+        *ierr=3;
     }
 }
 /*--------------------------------------------------------------------------*/
similarity index 83%
rename from scilab/modules/fileio/src/c/mput.c
rename to scilab/modules/fileio/src/cpp/mput.cpp
index 12ec80e..cb2d7b2 100644 (file)
@@ -12,6 +12,9 @@
  */
 /*--------------------------------------------------------------------------*/
 #include <string.h>
+#include "filemanager.hxx"
+extern "C"
+{
 #ifndef _MSC_VER
 #include <stdint.h> 
 #else
 #include "../../../libs/libst/misc.h"
 #include "localization.h"
 #include "sci_warning.h"
+#include "charEncoding.h"
+}
 /*--------------------------------------------------------------------------*/
-extern struct soundstream ftf; /* defined in mget.c */
-extern int swap; /* defined in mget.c */
-/*--------------------------------------------------------------------------*/
-
 /*===============================================
  * function to write data without type conversion
  *===============================================*/
@@ -72,7 +73,7 @@ extern int swap; /* defined in mget.c */
 void C2F(mputnc) (int *fd, void * res, int *n1, char *type, int *ierr)
 {
   char c1,c2;
-  int i,swap2,n;
+  int i,n;
   FILE *fa;
   n=*n1;
   *ierr=0;
@@ -84,7 +85,7 @@ void C2F(mputnc) (int *fd, void * res, int *n1, char *type, int *ierr)
     *ierr=3;
     return;
   }
-  swap2 = GetSwapStatus(*fd);
+  int swap = GetSwapStatus(*fd);
 
   c1 = ( strlen(type) > 1) ? type[1] : ' ';
   c2 = ( strlen(type) > 2) ? type[2] : ' ';
@@ -157,13 +158,11 @@ void C2F(mputnc) (int *fd, void * res, int *n1, char *type, int *ierr)
       *ierr=1;return;                                                  \
     }
 /*--------------------------------------------------------------------------*/
-void mput2 (FILE *fa, int swap2, double *res, int n, char *type, int *ierr)
+void mput2 (FILE *fa, int swap, double *res, int n, char *type, int *ierr)
 {
   char c1,c2;
   int i;
-  ft_t ft = &ftf;
   *ierr=0;
-  ft->fp = fa;
   c1 = ( strlen(type) > 1) ? type[1] : ' ';
   c2 = ( strlen(type) > 2) ? type[2] : ' ';
   switch ( type[0] )
@@ -191,39 +190,36 @@ void mput2 (FILE *fa, int swap2, double *res, int n, char *type, int *ierr)
 /*--------------------------------------------------------------------------*/
 void C2F(mput) (int *fd, double *res, int *n, char *type, int *ierr)
 {
-  int nc = 0,swap2 = 0;
-  FILE *fa = NULL;
-  *ierr = 0;
-  if ((nc = (int)strlen(type)) == 0)
-    {
-      if ( getWarningMode() ) sciprint(_("%s: Wrong size for input argument #%d ('%s'): Non-empty string expected.\n"),"mput",4,type);
-      *ierr = 2;
-      return;
-    }
-
-  if ( *fd == -1  &&  GetFileOpenedInScilab(*fd) == NULL )
+    *ierr = 0;
+    if(strlen(type) == 0)
     {
-      sciprint(_("%s: No File opened in Scilab.\n") , "mput" ) ;
-      *ierr = 3 ;
-      return ;
+        if(getWarningMode())
+        {
+            sciprintW(_W("%ls: Wrong size for input argument #%d ('%s'): Non-empty string expected.\n"), L"mput", 4, type);
+        }
+        *ierr = 2;
+        return;
     }
 
-  if ((fa = GetFileOpenedInScilab(*fd)) !=NULL)
+    File *pFile = FileManager::getFile(*fd);
+    if(pFile && pFile->getFiledesc())
     {
-      swap2 = GetSwapStatus(*fd);
-      mput2(fa,swap2,res,*n,type,ierr);
-      if (*ierr > 0) {
-       if ( getWarningMode() ) {
-         sciprint(_("%s: Wrong value for input argument #%d ('%s'): Format not recognized.\n"),"mput",4,type);
-       }
-      }
+        mput2(pFile->getFiledesc(), pFile->getFileSwap(), res, *n, type, ierr);
+        if(*ierr > 0) 
+        {
+            if(getWarningMode())
+            {
+                sciprintW(_W("%ls: Wrong value for input argument #%d ('%s'): Format not recognized.\n"), L"mput", 4, type);
+            }
+        }
     }
-  else
+    else
     {
-      if ( getWarningMode() ) {
-       sciprint(_("%s: Error while opening, reading or writing '%s'.\n"),"mput", GetFileNameOpenedInScilab(*fd));
-      }
-      *ierr=3;
+        if(getWarningMode())
+        {
+            sciprintW(_W("%ls: No input file associated to logical unit %d.\n"), L"mput", *fd);
+        }
+        *ierr=3;
     }
 }
 /*--------------------------------------------------------------------------*/
index 3988d72..4f1cf63 100644 (file)
 
 namespace types
 {
-    class File : public Double
+    class File
     {
     public :
                                     File();
                                     ~File();
 
-        virtual File*               getAsFile(void) { return this; }
-
         void                        setFileMode(wstring _pstMode);
         wstring&                    getFileMode();
 
index c94ab2b..c6237d0 100644 (file)
@@ -15,7 +15,7 @@
 namespace types
 {
 
-    File::File() : Double(0)
+    File::File()
     {
         m_fileDesc = NULL;
         m_iSwap = 0;