get_absolute_file_path, getrelativefilename, mclearerr, merror, pathsep added. 01/3801/7
cedric Delamarre [Thu, 14 Apr 2011 08:31:17 +0000 (10:31 +0200)]
Change-Id: Id993ad15d25015081e3cfd4d0cfaa16dd8be8bde

19 files changed:
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/cpp/fileio_gw.cpp
scilab/modules/fileio/sci_gateway/cpp/fileio_gw.vcproj
scilab/modules/fileio/sci_gateway/cpp/sci_get_absolute_file_path.cpp [new file with mode: 0644]
scilab/modules/fileio/sci_gateway/cpp/sci_getrelativefilename.cpp [new file with mode: 0644]
scilab/modules/fileio/sci_gateway/cpp/sci_mclearerr.cpp [new file with mode: 0644]
scilab/modules/fileio/sci_gateway/cpp/sci_merror.cpp [new file with mode: 0644]
scilab/modules/fileio/sci_gateway/cpp/sci_pathsep.cpp [new file with mode: 0644]
scilab/modules/fileio/src/c/getrelativefilename.c
scilab/modules/fileio/src/c/getrelativefilename.h
scilab/modules/fileio/src/c/mclearerr.c [deleted file]
scilab/modules/fileio/src/c/mclearerr.h [deleted file]
scilab/modules/fileio/src/c/merror.c [deleted file]
scilab/modules/fileio/src/c/merror.h [deleted file]

index 7b04e15..1a6d4ff 100644 (file)
@@ -15,8 +15,6 @@ src/c/filesmanagement.c \
 src/c/getfiledesc.c \
 src/c/getfileinfo.c \
 src/c/getfiletype.c \
-src/c/mclearerr.c \
-src/c/merror.c \
 src/c/mgeti.c \
 src/c/mputi.c \
 src/c/readline.c \
@@ -56,15 +54,10 @@ sci_gateway/c/sci_fprintfMat.c \
 sci_gateway/c/sci_fscanfMat.c \
 sci_gateway/c/sci_maxfiles.c \
 sci_gateway/c/sci_getdrives.c \
-sci_gateway/c/sci_pathsep.c \
 sci_gateway/c/sci_chdir.c \
 sci_gateway/c/sci_pwd.c \
 sci_gateway/c/sci_copyfile.c \
-sci_gateway/c/sci_movefile.c \
-sci_gateway/c/sci_get_absolute_file_path.c \
-sci_gateway/c/sci_getrelativefilename.c \
-sci_gateway/c/sci_mclearerr.c \
-sci_gateway/c/sci_merror.c
+sci_gateway/c/sci_movefile.c
 
 GATEWAY_CPP_SOURCES = \
        sci_gateway/cpp/fileio_gw.cpp \
@@ -94,7 +87,12 @@ GATEWAY_CPP_SOURCES = \
        sci_gateway/cpp/sci_mgetstr.cpp \
        sci_gateway/cpp/sci_mseek.cpp \
        sci_gateway/cpp/sci_mtell.cpp \
-       sci_gateway/cpp/sci_newest.cpp
+       sci_gateway/cpp/sci_newest.cpp \
+       sci_gateway/cpp/sci_merror.cpp \
+       sci_gateway/cpp/sci_mclearerr.cpp \
+       sci_gateway/cpp/sci_get_absolute_file_path.cpp \
+       sci_gateway/cpp/sci_getrelativefilename.cpp \
+       sci_gateway/cpp/sci_pathsep.cpp
 
 FILEIO_CPP_SOURCES = \
        src/cpp/expandPathVariable.cpp \
index 0a0682e..714795a 100644 (file)
@@ -122,9 +122,8 @@ am__objects_1 = libscifileio_algo_la-FileExist.lo \
        libscifileio_algo_la-getfiledesc.lo \
        libscifileio_algo_la-getfileinfo.lo \
        libscifileio_algo_la-getfiletype.lo \
-       libscifileio_algo_la-mclearerr.lo \
-       libscifileio_algo_la-merror.lo libscifileio_algo_la-mgeti.lo \
-       libscifileio_algo_la-mputi.lo libscifileio_algo_la-readline.lo \
+       libscifileio_algo_la-mgeti.lo libscifileio_algo_la-mputi.lo \
+       libscifileio_algo_la-readline.lo \
        libscifileio_algo_la-getdrives.lo \
        libscifileio_algo_la-deleteafile.lo \
        libscifileio_algo_la-getshortpathname.lo \
@@ -170,13 +169,9 @@ am__objects_3 = libscifileio_la-gw_fileio.lo \
        libscifileio_la-sci_fprintfMat.lo \
        libscifileio_la-sci_fscanfMat.lo \
        libscifileio_la-sci_maxfiles.lo \
-       libscifileio_la-sci_getdrives.lo \
-       libscifileio_la-sci_pathsep.lo libscifileio_la-sci_chdir.lo \
+       libscifileio_la-sci_getdrives.lo libscifileio_la-sci_chdir.lo \
        libscifileio_la-sci_pwd.lo libscifileio_la-sci_copyfile.lo \
-       libscifileio_la-sci_movefile.lo \
-       libscifileio_la-sci_get_absolute_file_path.lo \
-       libscifileio_la-sci_getrelativefilename.lo \
-       libscifileio_la-sci_mclearerr.lo libscifileio_la-sci_merror.lo
+       libscifileio_la-sci_movefile.lo
 am__objects_4 = libscifileio_la-fileio_gw.lo \
        libscifileio_la-sci_mopen.lo libscifileio_la-sci_mclose.lo \
        libscifileio_la-sci_mget.lo libscifileio_la-sci_mput.lo \
@@ -196,7 +191,11 @@ am__objects_4 = libscifileio_la-fileio_gw.lo \
        libscifileio_la-sci_removedir.lo libscifileio_la-sci_meof.lo \
        libscifileio_la-sci_mputstr.lo libscifileio_la-sci_mgetstr.lo \
        libscifileio_la-sci_mseek.lo libscifileio_la-sci_mtell.lo \
-       libscifileio_la-sci_newest.lo
+       libscifileio_la-sci_newest.lo libscifileio_la-sci_merror.lo \
+       libscifileio_la-sci_mclearerr.lo \
+       libscifileio_la-sci_get_absolute_file_path.lo \
+       libscifileio_la-sci_getrelativefilename.lo \
+       libscifileio_la-sci_pathsep.lo
 am_libscifileio_la_OBJECTS = $(am__objects_3) $(am__objects_4)
 libscifileio_la_OBJECTS = $(am_libscifileio_la_OBJECTS)
 libscifileio_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \
@@ -501,8 +500,6 @@ src/c/filesmanagement.c \
 src/c/getfiledesc.c \
 src/c/getfileinfo.c \
 src/c/getfiletype.c \
-src/c/mclearerr.c \
-src/c/merror.c \
 src/c/mgeti.c \
 src/c/mputi.c \
 src/c/readline.c \
@@ -541,15 +538,10 @@ sci_gateway/c/sci_fprintfMat.c \
 sci_gateway/c/sci_fscanfMat.c \
 sci_gateway/c/sci_maxfiles.c \
 sci_gateway/c/sci_getdrives.c \
-sci_gateway/c/sci_pathsep.c \
 sci_gateway/c/sci_chdir.c \
 sci_gateway/c/sci_pwd.c \
 sci_gateway/c/sci_copyfile.c \
-sci_gateway/c/sci_movefile.c \
-sci_gateway/c/sci_get_absolute_file_path.c \
-sci_gateway/c/sci_getrelativefilename.c \
-sci_gateway/c/sci_mclearerr.c \
-sci_gateway/c/sci_merror.c
+sci_gateway/c/sci_movefile.c
 
 GATEWAY_CPP_SOURCES = \
        sci_gateway/cpp/fileio_gw.cpp \
@@ -579,7 +571,12 @@ GATEWAY_CPP_SOURCES = \
        sci_gateway/cpp/sci_mgetstr.cpp \
        sci_gateway/cpp/sci_mseek.cpp \
        sci_gateway/cpp/sci_mtell.cpp \
-       sci_gateway/cpp/sci_newest.cpp
+       sci_gateway/cpp/sci_newest.cpp \
+       sci_gateway/cpp/sci_merror.cpp \
+       sci_gateway/cpp/sci_mclearerr.cpp \
+       sci_gateway/cpp/sci_get_absolute_file_path.cpp \
+       sci_gateway/cpp/sci_getrelativefilename.cpp \
+       sci_gateway/cpp/sci_pathsep.cpp
 
 FILEIO_CPP_SOURCES = \
        src/cpp/expandPathVariable.cpp \
@@ -841,9 +838,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscifileio_algo_la-getshortpathname.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscifileio_algo_la-isDrive.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscifileio_algo_la-isdir.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscifileio_algo_la-mclearerr.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscifileio_algo_la-mclose.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscifileio_algo_la-merror.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscifileio_algo_la-mget.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscifileio_algo_la-mgeti.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscifileio_algo_la-mgetl.Plo@am__quote@
@@ -1008,20 +1003,6 @@ libscifileio_algo_la-getfiletype.lo: src/c/getfiletype.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_algo_la_CPPFLAGS) $(CPPFLAGS) $(libscifileio_algo_la_CFLAGS) $(CFLAGS) -c -o libscifileio_algo_la-getfiletype.lo `test -f 'src/c/getfiletype.c' || echo '$(srcdir)/'`src/c/getfiletype.c
 
-libscifileio_algo_la-mclearerr.lo: src/c/mclearerr.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscifileio_algo_la_CPPFLAGS) $(CPPFLAGS) $(libscifileio_algo_la_CFLAGS) $(CFLAGS) -MT libscifileio_algo_la-mclearerr.lo -MD -MP -MF $(DEPDIR)/libscifileio_algo_la-mclearerr.Tpo -c -o libscifileio_algo_la-mclearerr.lo `test -f 'src/c/mclearerr.c' || echo '$(srcdir)/'`src/c/mclearerr.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscifileio_algo_la-mclearerr.Tpo $(DEPDIR)/libscifileio_algo_la-mclearerr.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/mclearerr.c' object='libscifileio_algo_la-mclearerr.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_algo_la_CPPFLAGS) $(CPPFLAGS) $(libscifileio_algo_la_CFLAGS) $(CFLAGS) -c -o libscifileio_algo_la-mclearerr.lo `test -f 'src/c/mclearerr.c' || echo '$(srcdir)/'`src/c/mclearerr.c
-
-libscifileio_algo_la-merror.lo: src/c/merror.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscifileio_algo_la_CPPFLAGS) $(CPPFLAGS) $(libscifileio_algo_la_CFLAGS) $(CFLAGS) -MT libscifileio_algo_la-merror.lo -MD -MP -MF $(DEPDIR)/libscifileio_algo_la-merror.Tpo -c -o libscifileio_algo_la-merror.lo `test -f 'src/c/merror.c' || echo '$(srcdir)/'`src/c/merror.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscifileio_algo_la-merror.Tpo $(DEPDIR)/libscifileio_algo_la-merror.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/merror.c' object='libscifileio_algo_la-merror.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_algo_la_CPPFLAGS) $(CPPFLAGS) $(libscifileio_algo_la_CFLAGS) $(CFLAGS) -c -o libscifileio_algo_la-merror.lo `test -f 'src/c/merror.c' || echo '$(srcdir)/'`src/c/merror.c
-
 libscifileio_algo_la-mgeti.lo: src/c/mgeti.c
 @am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscifileio_algo_la_CPPFLAGS) $(CPPFLAGS) $(libscifileio_algo_la_CFLAGS) $(CFLAGS) -MT libscifileio_algo_la-mgeti.lo -MD -MP -MF $(DEPDIR)/libscifileio_algo_la-mgeti.Tpo -c -o libscifileio_algo_la-mgeti.lo `test -f 'src/c/mgeti.c' || echo '$(srcdir)/'`src/c/mgeti.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscifileio_algo_la-mgeti.Tpo $(DEPDIR)/libscifileio_algo_la-mgeti.Plo
@@ -1274,13 +1255,6 @@ libscifileio_la-sci_getdrives.lo: sci_gateway/c/sci_getdrives.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_getdrives.lo `test -f 'sci_gateway/c/sci_getdrives.c' || echo '$(srcdir)/'`sci_gateway/c/sci_getdrives.c
 
-libscifileio_la-sci_pathsep.lo: sci_gateway/c/sci_pathsep.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_pathsep.lo -MD -MP -MF $(DEPDIR)/libscifileio_la-sci_pathsep.Tpo -c -o libscifileio_la-sci_pathsep.lo `test -f 'sci_gateway/c/sci_pathsep.c' || echo '$(srcdir)/'`sci_gateway/c/sci_pathsep.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscifileio_la-sci_pathsep.Tpo $(DEPDIR)/libscifileio_la-sci_pathsep.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/sci_pathsep.c' object='libscifileio_la-sci_pathsep.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_pathsep.lo `test -f 'sci_gateway/c/sci_pathsep.c' || echo '$(srcdir)/'`sci_gateway/c/sci_pathsep.c
-
 libscifileio_la-sci_chdir.lo: sci_gateway/c/sci_chdir.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_chdir.lo -MD -MP -MF $(DEPDIR)/libscifileio_la-sci_chdir.Tpo -c -o libscifileio_la-sci_chdir.lo `test -f 'sci_gateway/c/sci_chdir.c' || echo '$(srcdir)/'`sci_gateway/c/sci_chdir.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscifileio_la-sci_chdir.Tpo $(DEPDIR)/libscifileio_la-sci_chdir.Plo
@@ -1309,34 +1283,6 @@ libscifileio_la-sci_movefile.lo: sci_gateway/c/sci_movefile.c
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscifileio_la_CPPFLAGS) $(CPPFLAGS) $(libscifileio_la_CFLAGS) $(CFLAGS) -c -o libscifileio_la-sci_movefile.lo `test -f 'sci_gateway/c/sci_movefile.c' || echo '$(srcdir)/'`sci_gateway/c/sci_movefile.c
 
-libscifileio_la-sci_get_absolute_file_path.lo: sci_gateway/c/sci_get_absolute_file_path.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_get_absolute_file_path.lo -MD -MP -MF $(DEPDIR)/libscifileio_la-sci_get_absolute_file_path.Tpo -c -o libscifileio_la-sci_get_absolute_file_path.lo `test -f 'sci_gateway/c/sci_get_absolute_file_path.c' || echo '$(srcdir)/'`sci_gateway/c/sci_get_absolute_file_path.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscifileio_la-sci_get_absolute_file_path.Tpo $(DEPDIR)/libscifileio_la-sci_get_absolute_file_path.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/sci_get_absolute_file_path.c' object='libscifileio_la-sci_get_absolute_file_path.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_get_absolute_file_path.lo `test -f 'sci_gateway/c/sci_get_absolute_file_path.c' || echo '$(srcdir)/'`sci_gateway/c/sci_get_absolute_file_path.c
-
-libscifileio_la-sci_getrelativefilename.lo: sci_gateway/c/sci_getrelativefilename.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_getrelativefilename.lo -MD -MP -MF $(DEPDIR)/libscifileio_la-sci_getrelativefilename.Tpo -c -o libscifileio_la-sci_getrelativefilename.lo `test -f 'sci_gateway/c/sci_getrelativefilename.c' || echo '$(srcdir)/'`sci_gateway/c/sci_getrelativefilename.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscifileio_la-sci_getrelativefilename.Tpo $(DEPDIR)/libscifileio_la-sci_getrelativefilename.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/sci_getrelativefilename.c' object='libscifileio_la-sci_getrelativefilename.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_getrelativefilename.lo `test -f 'sci_gateway/c/sci_getrelativefilename.c' || echo '$(srcdir)/'`sci_gateway/c/sci_getrelativefilename.c
-
-libscifileio_la-sci_mclearerr.lo: sci_gateway/c/sci_mclearerr.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_mclearerr.lo -MD -MP -MF $(DEPDIR)/libscifileio_la-sci_mclearerr.Tpo -c -o libscifileio_la-sci_mclearerr.lo `test -f 'sci_gateway/c/sci_mclearerr.c' || echo '$(srcdir)/'`sci_gateway/c/sci_mclearerr.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscifileio_la-sci_mclearerr.Tpo $(DEPDIR)/libscifileio_la-sci_mclearerr.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/sci_mclearerr.c' object='libscifileio_la-sci_mclearerr.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_mclearerr.lo `test -f 'sci_gateway/c/sci_mclearerr.c' || echo '$(srcdir)/'`sci_gateway/c/sci_mclearerr.c
-
-libscifileio_la-sci_merror.lo: sci_gateway/c/sci_merror.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_merror.lo -MD -MP -MF $(DEPDIR)/libscifileio_la-sci_merror.Tpo -c -o libscifileio_la-sci_merror.lo `test -f 'sci_gateway/c/sci_merror.c' || echo '$(srcdir)/'`sci_gateway/c/sci_merror.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscifileio_la-sci_merror.Tpo $(DEPDIR)/libscifileio_la-sci_merror.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/sci_merror.c' object='libscifileio_la-sci_merror.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_merror.lo `test -f 'sci_gateway/c/sci_merror.c' || echo '$(srcdir)/'`sci_gateway/c/sci_merror.c
-
 .cpp.o:
 @am__fastdepCXX_TRUE@  $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
 @am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@@ -1638,6 +1584,41 @@ libscifileio_la-sci_newest.lo: sci_gateway/cpp/sci_newest.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_newest.lo `test -f 'sci_gateway/cpp/sci_newest.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_newest.cpp
 
+libscifileio_la-sci_merror.lo: sci_gateway/cpp/sci_merror.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_merror.lo -MD -MP -MF $(DEPDIR)/libscifileio_la-sci_merror.Tpo -c -o libscifileio_la-sci_merror.lo `test -f 'sci_gateway/cpp/sci_merror.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_merror.cpp
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscifileio_la-sci_merror.Tpo $(DEPDIR)/libscifileio_la-sci_merror.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='sci_gateway/cpp/sci_merror.cpp' object='libscifileio_la-sci_merror.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_merror.lo `test -f 'sci_gateway/cpp/sci_merror.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_merror.cpp
+
+libscifileio_la-sci_mclearerr.lo: sci_gateway/cpp/sci_mclearerr.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_mclearerr.lo -MD -MP -MF $(DEPDIR)/libscifileio_la-sci_mclearerr.Tpo -c -o libscifileio_la-sci_mclearerr.lo `test -f 'sci_gateway/cpp/sci_mclearerr.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_mclearerr.cpp
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscifileio_la-sci_mclearerr.Tpo $(DEPDIR)/libscifileio_la-sci_mclearerr.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='sci_gateway/cpp/sci_mclearerr.cpp' object='libscifileio_la-sci_mclearerr.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_mclearerr.lo `test -f 'sci_gateway/cpp/sci_mclearerr.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_mclearerr.cpp
+
+libscifileio_la-sci_get_absolute_file_path.lo: sci_gateway/cpp/sci_get_absolute_file_path.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_get_absolute_file_path.lo -MD -MP -MF $(DEPDIR)/libscifileio_la-sci_get_absolute_file_path.Tpo -c -o libscifileio_la-sci_get_absolute_file_path.lo `test -f 'sci_gateway/cpp/sci_get_absolute_file_path.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_get_absolute_file_path.cpp
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscifileio_la-sci_get_absolute_file_path.Tpo $(DEPDIR)/libscifileio_la-sci_get_absolute_file_path.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='sci_gateway/cpp/sci_get_absolute_file_path.cpp' object='libscifileio_la-sci_get_absolute_file_path.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_get_absolute_file_path.lo `test -f 'sci_gateway/cpp/sci_get_absolute_file_path.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_get_absolute_file_path.cpp
+
+libscifileio_la-sci_getrelativefilename.lo: sci_gateway/cpp/sci_getrelativefilename.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_getrelativefilename.lo -MD -MP -MF $(DEPDIR)/libscifileio_la-sci_getrelativefilename.Tpo -c -o libscifileio_la-sci_getrelativefilename.lo `test -f 'sci_gateway/cpp/sci_getrelativefilename.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_getrelativefilename.cpp
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscifileio_la-sci_getrelativefilename.Tpo $(DEPDIR)/libscifileio_la-sci_getrelativefilename.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='sci_gateway/cpp/sci_getrelativefilename.cpp' object='libscifileio_la-sci_getrelativefilename.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_getrelativefilename.lo `test -f 'sci_gateway/cpp/sci_getrelativefilename.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_getrelativefilename.cpp
+
+libscifileio_la-sci_pathsep.lo: sci_gateway/cpp/sci_pathsep.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_pathsep.lo -MD -MP -MF $(DEPDIR)/libscifileio_la-sci_pathsep.Tpo -c -o libscifileio_la-sci_pathsep.lo `test -f 'sci_gateway/cpp/sci_pathsep.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_pathsep.cpp
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscifileio_la-sci_pathsep.Tpo $(DEPDIR)/libscifileio_la-sci_pathsep.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='sci_gateway/cpp/sci_pathsep.cpp' object='libscifileio_la-sci_pathsep.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_pathsep.lo `test -f 'sci_gateway/cpp/sci_pathsep.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_pathsep.cpp
+
 mostlyclean-libtool:
        -rm -f *.lo
 
index cdc9334..d7a4c44 100644 (file)
                                >
                        </File>
                        <File
-                               RelativePath=".\src\c\mclearerr.c"
-                               >
-                       </File>
-                       <File
                                RelativePath=".\src\cpp\mclose.cpp"
                                >
                        </File>
                        <File
-                               RelativePath=".\src\c\merror.c"
-                               >
-                       </File>
-                       <File
                                RelativePath=".\src\cpp\mget.cpp"
                                >
                        </File>
                                >
                        </File>
                        <File
-                               RelativePath=".\sci_gateway\c\sci_mclearerr.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\sci_gateway\c\sci_merror.c"
-                               >
-                       </File>
-                       <File
                                RelativePath=".\sci_gateway\c\sci_mfprintf.c"
                                >
                        </File>
                                >
                        </File>
                        <File
-                               RelativePath=".\sci_gateway\c\sci_pathsep.c"
-                               >
-                       </File>
-                       <File
                                RelativePath=".\sci_gateway\c\sci_pwd.c"
                                >
                        </File>
index 1f8bb1d..19e12a1 100644 (file)
@@ -63,5 +63,11 @@ CPP_GATEWAY_PROTOTYPE(sci_mgetstr);
 CPP_GATEWAY_PROTOTYPE(sci_mseek);
 CPP_GATEWAY_PROTOTYPE(sci_mtell);
 CPP_GATEWAY_PROTOTYPE(sci_newest);
+CPP_GATEWAY_PROTOTYPE(sci_merror);
+CPP_GATEWAY_PROTOTYPE(sci_mclearerr);
+CPP_GATEWAY_PROTOTYPE(sci_get_absolute_file_path);
+CPP_GATEWAY_PROTOTYPE(sci_getrelativefilename);
+CPP_GATEWAY_PROTOTYPE(sci_pathsep);
+
 
 #endif /* !__FILEIO_GW_HXX__ */
index 9dd0513..4f94cbe 100644 (file)
 /*--------------------------------------------------------------------------*/
 FILEIO_IMPEXP int gw_fileio(void);
 /*--------------------------------------------------------------------------*/
-FILEIO_IMPEXP int sci_merror(char *fname,unsigned long fname_len);
-FILEIO_IMPEXP int sci_mclearerr(char *fname,unsigned long fname_len);
+
 FILEIO_IMPEXP int sci_mfprintf(char *fname,unsigned long fname_len);
 FILEIO_IMPEXP int sci_scanf(char *fname,unsigned long fname_len);
 FILEIO_IMPEXP int sci_sscanf(char *fname,unsigned long fname_len);
 FILEIO_IMPEXP int sci_fscanf(char *fname,unsigned long fname_len);
 FILEIO_IMPEXP int sci_maxfiles(char *fname,unsigned long fname_len);
 FILEIO_IMPEXP int sci_getdrives(char *fname,unsigned long fname_len);
-FILEIO_IMPEXP int sci_pathsep(char *fname,unsigned long fname_len);
-FILEIO_IMPEXP int sci_getrelativefilename(char *fname, unsigned long l);
-FILEIO_IMPEXP int sci_get_absolute_file_path(char *fname,unsigned long fname_len);
 
 //YaSp
 FILEIO_IMPEXP int sci_pwd(char *fname, int* _piKey);
index 42cb26b..d5e7c3c 100644 (file)
@@ -28,20 +28,20 @@ static gw_generic_table Tab[]={
        {NULL, ""}, //meof
        {NULL, ""}, //mseek
        {NULL, ""}, //mtell
-       {sci_mclearerr, "mclearerr"},
+       {NULL, ""}, //mclearerr
        {sci_mfprintf,"mfprintf"}, //
        {sci_scanf,"mscanf"}, //
        {sci_fscanf,"mfscanf"}, //
        {sci_sscanf,"msscanf"}, //
        {sci_fscanfMat,"fscanfMat"},
        {sci_fprintfMat,"fprintfMat"},
-       {sci_merror, "merror"},
+       {NULL, ""}, //merror
        {NULL, ""}, //findfiles
        {sci_maxfiles,"maxfiles"},
        {sci_getdrives,"getdrives"},
        {NULL, ""}, //fullpath
        {NULL, ""}, //deletefile
-       {sci_pathsep,"pathsep"},
+       {NULL, ""}, //pathsep
        {NULL, ""}, //filesep
        {NULL, ""}, //getlongpathname
        {NULL, ""}, //getshortpathname
@@ -53,8 +53,8 @@ static gw_generic_table Tab[]={
        {NULL, ""}, //chdir
        {NULL, ""}, //fileinfo
        {NULL, ""}, //newest
-       {sci_getrelativefilename,"getrelativefilename"},
-       {sci_get_absolute_file_path,"get_absolute_file_path"},
+       {NULL, ""}, //getrelativefilename
+       {NULL, ""}, //get_absolute_file_path
        {NULL, ""}, //copyfile
        {NULL, ""}, //isfile
        {NULL, ""}, //fileparts
index 2e68a87..bd88886 100644 (file)
@@ -54,6 +54,11 @@ bool FileioModule::Load()
     symbol::Context::getInstance()->AddFunction(Function::createFunction(L"mseek", &sci_mseek, MODULE_NAME));
     symbol::Context::getInstance()->AddFunction(Function::createFunction(L"mtell", &sci_mtell, MODULE_NAME));
     symbol::Context::getInstance()->AddFunction(Function::createFunction(L"newest", &sci_newest, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(Function::createFunction(L"merror", &sci_merror, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(Function::createFunction(L"mclearerr", &sci_mclearerr, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(Function::createFunction(L"get_absolute_file_path", &sci_get_absolute_file_path, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(Function::createFunction(L"getrelativefilename", &sci_getrelativefilename, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(Function::createFunction(L"pathsep", &sci_pathsep, MODULE_NAME));
 
     return true;
 }
index b7a6ac0..48951a7 100644 (file)
                                >
                        </File>
                        <File
+                               RelativePath=".\sci_get_absolute_file_path.cpp"
+                               >
+                       </File>
+                       <File
                                RelativePath=".\sci_getlongpathname.cpp"
                                >
                        </File>
                        <File
+                               RelativePath=".\sci_getrelativefilename.cpp"
+                               >
+                       </File>
+                       <File
                                RelativePath=".\sci_getshortpathname.cpp"
                                >
                        </File>
                                >
                        </File>
                        <File
+                               RelativePath=".\sci_mclearerr.cpp"
+                               >
+                       </File>
+                       <File
                                RelativePath=".\sci_mclose.cpp"
                                >
                        </File>
                                >
                        </File>
                        <File
+                               RelativePath=".\sci_merror.cpp"
+                               >
+                       </File>
+                       <File
                                RelativePath=".\sci_mget.cpp"
                                >
                        </File>
                                >
                        </File>
                        <File
+                               RelativePath=".\sci_pathsep.cpp"
+                               >
+                       </File>
+                       <File
                                RelativePath=".\sci_removedir.cpp"
                                >
                        </File>
diff --git a/scilab/modules/fileio/sci_gateway/cpp/sci_get_absolute_file_path.cpp b/scilab/modules/fileio/sci_gateway/cpp/sci_get_absolute_file_path.cpp
new file mode 100644 (file)
index 0000000..e555986
--- /dev/null
@@ -0,0 +1,83 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2011 - Digiteo - Cedric DELAMARRE
+ *
+ *
+ * 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 "fileio_gw.hxx"
+#include "function.hxx"
+#include "string.hxx"
+#include "filemanager.hxx"
+
+extern "C"
+{
+#include <stdio.h>
+#include <string.h>
+#include "MALLOC.h"
+#include "Scierror.h"
+#include "localization.h"
+}
+/*--------------------------------------------------------------------------*/
+
+
+Function::ReturnValue sci_get_absolute_file_path(types::typed_list &in, int _iRetCount, types::typed_list &out)
+{
+    int dimsArray[2]                = {1,1};
+    wchar_t* wcsFileName            = NULL;
+    wchar_t** wcsFilesOpened        = NULL;
+    wchar_t* wcsTemp                = NULL;
+    wchar_t* wcsPath                = NULL;
+    
+    if(in.size() != 1)
+    {
+        ScierrorW(77, _W("%ls: Wrong number of input argument(s): %d expected.\n"), L"get_absolute_file_path", 1);
+        return types::Function::Error;
+    }
+
+    if(in[0]->isString() == false || in[0]->getAs<types::String>()->isScalar() == false)
+    {
+        ScierrorW(999,_W("%ls: Wrong type for input argument #%d: A String expected.\n"), L"get_absolute_file_path", 1);
+        return types::Function::Error;
+    }
+
+    wcsFileName = in[0]->getAs<types::String>()->get(0);
+    wcsFilesOpened = FileManager::getFilenames();
+
+    for(int i = FileManager::getOpenedCount()-1; i >= 0; i--)
+    {
+        wcsTemp = wcsstr(wcsFilesOpened[i], wcsFileName);
+        if(wcsTemp)
+        {
+            int iSize = (int)(wcsTemp - wcsFilesOpened[i]);
+            wcsPath = (wchar_t*)MALLOC((iSize + 1) * sizeof(wchar_t));
+            memcpy(wcsPath, wcsFilesOpened[i], iSize * sizeof(wchar_t));
+            wcsPath[iSize] = L'\0';
+            if(wcslen(wcsFilesOpened[i]) == wcslen(wcsFileName) + iSize)
+            {
+                types::String* pStringOut = new types::String(2, dimsArray);
+                pStringOut->set(0, wcsPath);
+                out.push_back(pStringOut);
+                return types::Function::OK;
+            }
+            else
+            {
+                wcsTemp = NULL;
+            }
+        }
+    }
+    
+    if(wcsTemp == NULL)
+    {
+        ScierrorW(999,_W("%ls: The file %ls is not opened in scilab.\n"), L"get_absolute_file_path", wcsFileName);
+        return types::Function::Error;
+    }
+}
+/*--------------------------------------------------------------------------*/
diff --git a/scilab/modules/fileio/sci_gateway/cpp/sci_getrelativefilename.cpp b/scilab/modules/fileio/sci_gateway/cpp/sci_getrelativefilename.cpp
new file mode 100644 (file)
index 0000000..c1ce160
--- /dev/null
@@ -0,0 +1,95 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2011 - Digiteo - Cedric DELAMARRE
+ *
+ *
+ * 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 "fileio_gw.hxx"
+#include "function.hxx"
+#include "string.hxx"
+#include "filemanager.hxx"
+
+extern "C"
+{
+#include <stdio.h>
+#include <string.h>
+#include "PATH_MAX.h"
+#include "isdir.h"
+#include "FileExist.h"
+#include "expandPathVariable.h"
+#include "MALLOC.h"
+#include "Scierror.h"
+#include "localization.h"
+#include "getrelativefilename.h"
+}
+/*--------------------------------------------------------------------------*/
+
+
+Function::ReturnValue sci_getrelativefilename(types::typed_list &in, int _iRetCount, types::typed_list &out)
+{
+    int dimsArray[2]    = {1,1};
+    wchar_t* wcsAbsDir  = NULL;
+    wchar_t* wcsAbsFile = NULL;
+    wchar_t* wcsResult  = NULL;
+
+    if(in.size() != 2)
+    {
+        ScierrorW(77, _W("%ls: Wrong number of input argument(s): %d expected.\n"), L"getrelativefilename", 2);
+        return types::Function::Error;
+    }
+
+    if(in[0]->isString() == false || in[0]->getAs<types::String>()->isScalar() == false)
+    {
+        ScierrorW(999,_W("%ls: Wrong type for input argument #%d: A String expected.\n"), L"getrelativefilename", 1);
+        return types::Function::Error;
+    }
+
+    if(in[1]->isString() == false || in[1]->getAs<types::String>()->isScalar() == false)
+    {
+        ScierrorW(999,_W("%ls: Wrong type for input argument #%d: A String expected.\n"), L"getrelativefilename", 2);
+        return types::Function::Error;
+    }
+
+    wcsAbsDir = expandPathVariableW(in[0]->getAs<types::String>()->get(0));
+    if(wcslen(wcsAbsDir) > PATH_MAX)
+    {
+               ScierrorW(999,_W("%ls: Wrong size for input argument #%d: Must be less than %d characters.\n"), L"getrelativefilename", 1, PATH_MAX);
+        return types::Function::Error;
+    }
+    if(!isdirW(wcsAbsDir))
+    {
+        ScierrorW(999,_W("%ls: Directory '%ls' doesn't exists.\n"), L"getrelativefilename", wcsAbsDir);
+        return types::Function::Error;
+    }
+    
+    wcsAbsFile = expandPathVariableW(in[1]->getAs<types::String>()->get(0));
+    if(wcslen(wcsAbsFile) > PATH_MAX)
+    {
+               ScierrorW(999,_W("%ls: Wrong size for input argument #%d: Must be less than %d characters.\n"), L"getrelativefilename", 2, PATH_MAX);
+        return types::Function::Error;
+    }
+    if(!FileExistW(wcsAbsFile))
+    {
+        ScierrorW(999,_W("%ls: File '%ls' doesn't exists.\n"), L"getrelativefilename", wcsAbsFile);
+        return types::Function::Error;
+    }
+
+       wcsResult = getrelativefilenameW(wcsAbsDir, wcsAbsFile);
+
+    FREE(wcsAbsDir);
+    FREE(wcsAbsFile);
+
+    types::String* pOut = new types::String(2,dimsArray);
+    pOut->set(0, wcsResult);
+    out.push_back(pOut);
+    return types::Function::OK;
+}
+/*--------------------------------------------------------------------------*/
diff --git a/scilab/modules/fileio/sci_gateway/cpp/sci_mclearerr.cpp b/scilab/modules/fileio/sci_gateway/cpp/sci_mclearerr.cpp
new file mode 100644 (file)
index 0000000..35ab688
--- /dev/null
@@ -0,0 +1,72 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2011 - Digiteo - Cedric DELAMARRE
+ *
+ *
+ * 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 "fileio_gw.hxx"
+#include "function.hxx"
+#include "string.hxx"
+#include "filemanager.hxx"
+
+extern "C"
+{
+#include <stdio.h>
+#include <string.h>
+#include "expandPathVariable.h"
+#include "sci_warning.h"
+#include "sciprint.h"
+#include "Scierror.h"
+#include "localization.h"
+}
+/*--------------------------------------------------------------------------*/
+
+
+Function::ReturnValue sci_mclearerr(types::typed_list &in, int _iRetCount, types::typed_list &out)
+{
+    int iRet  = 0;
+    int iFile = -1; //default file : last opened file
+    
+    if(in.size() > 1)
+    {
+        ScierrorW(77, _W("%ls: Wrong number of input argument(s): %d to %d expected.\n"), L"mclearerr", 0, 1);
+        return types::Function::Error;
+    }
+    if(in.size() == 1)
+    {
+        if(in[0]->isDouble() == false || in[0]->getAs<types::Double>()->isScalar() == false || in[0]->getAs<types::Double>()->isComplex())
+        {
+            ScierrorW(999,_W("%ls: Wrong type for input argument #%d: A real expected.\n"), L"mclearerr", 1);
+            return types::Function::Error;
+        }
+
+        iFile = (int)in[0]->getAs<types::Double>()->get(0);
+    }
+
+    File* pF = FileManager::getFile(iFile);
+    if(pF != NULL)
+    {
+        clearerr(pF->getFiledesc());
+        iRet = 1;
+    }
+    else
+    {
+        if (getWarningMode())
+        {
+            sciprintW(_W("%ls: Cannot check the end of file whose descriptor is %d: File is not active.\n"), L"mclearerr", iFile);
+        }
+    }
+
+    types::Bool* pOut = new types::Bool(iRet);
+    out.push_back(pOut);
+    return types::Function::OK;
+}
+/*--------------------------------------------------------------------------*/
diff --git a/scilab/modules/fileio/sci_gateway/cpp/sci_merror.cpp b/scilab/modules/fileio/sci_gateway/cpp/sci_merror.cpp
new file mode 100644 (file)
index 0000000..cb060b0
--- /dev/null
@@ -0,0 +1,84 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2011 - Digiteo - Cedric DELAMARRE
+ *
+ *
+ * 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 "fileio_gw.hxx"
+#include "function.hxx"
+#include "string.hxx"
+#include "filemanager.hxx"
+
+extern "C"
+{
+#include <stdio.h>
+#include <string.h>
+#include "sci_warning.h"
+#include "sciprint.h"
+#include "Scierror.h"
+#include "localization.h"
+}
+/*--------------------------------------------------------------------------*/
+
+
+Function::ReturnValue sci_merror(types::typed_list &in, int _iRetCount, types::typed_list &out)
+{
+    int iRet  = 0;
+    int iFile = -1; //default file : last opened file
+    int dimsArray[2] = {1,1};
+    
+    if(in.size() > 1)
+    {
+        ScierrorW(77, _W("%ls: Wrong number of input argument(s): %d to %d expected.\n"), L"merror", 0, 1);
+        return types::Function::Error;
+    }
+    if(in.size() == 1)
+    {
+        if(in[0]->isDouble() == false || in[0]->getAs<types::Double>()->isScalar() == false || in[0]->getAs<types::Double>()->isComplex())
+        {
+            ScierrorW(999,_W("%ls: Wrong type for input argument #%d: A real expected.\n"), L"merror", 1);
+            return types::Function::Error;
+        }
+
+        iFile = (int)in[0]->getAs<types::Double>()->get(0);
+    }
+
+    File* pF = FileManager::getFile(iFile);
+    if(pF != NULL)
+    {
+        iRet = ferror(pF->getFiledesc());
+    }
+    else
+    {
+        if (getWarningMode())
+        {
+            sciprintW(_W("%ls: Cannot check the end of file whose descriptor is %d: File is not active.\n"), L"merror", iFile);
+        }
+        
+        types::Bool* pOut = new types::Bool(0);
+        out.push_back(pOut);
+        return types::Function::OK;
+    }
+
+    types::Double* pDoubleOut = new types::Double(2, dimsArray);
+    pDoubleOut->set(0, iRet);
+    out.push_back(pDoubleOut);
+    
+    if(_iRetCount == 2)
+    {
+        types::String* pStringOut = new types::String(2, dimsArray);
+        pStringOut->set(0, to_wide_string(strerror(iRet)));
+        out.push_back(pStringOut);
+    }
+    
+    return types::Function::OK;
+}
+/*--------------------------------------------------------------------------*/
diff --git a/scilab/modules/fileio/sci_gateway/cpp/sci_pathsep.cpp b/scilab/modules/fileio/sci_gateway/cpp/sci_pathsep.cpp
new file mode 100644 (file)
index 0000000..de64221
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2011 - Digiteo - Cedric DELAMARRE
+ *
+ *
+ * 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 "function.hxx"
+#include "string.hxx"
+#include "funcmanager.hxx"
+#include "fileio_gw.hxx"
+
+extern "C"
+{
+#include <stdio.h>
+#include <string.h>
+#include "Scierror.h"
+#include "localization.h"
+}
+/*--------------------------------------------------------------------------*/
+
+types::Function::ReturnValue sci_pathsep(types::typed_list &in, int _iRetCount, types::typed_list &out)
+{
+    int dimsArray[2]    = {1,1};
+    wchar_t* wcsSep     = to_wide_string(PATH_SEPARATOR);
+    
+    if(in.size() > 0)
+    {
+        ScierrorW(77, _W("%ls: Wrong number of input argument(s): %d expected.\n"), L"pathsep", 0);
+        return types::Function::Error;
+    }
+
+    types::String* pOut = new types::String(2, dimsArray);
+    pOut->set(0, wcsSep);
+    out.push_back(pOut);
+    return types::Function::OK;
+}
+/*--------------------------------------------------------------------------*/
index acf16d0..83e7674 100644 (file)
@@ -1,7 +1,8 @@
 /*
 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
 * Copyright (C) 2006 - INRIA - Pierre MARECHAL
-* 
+* Copyright (C) 2011 - Digiteo - Cedric DELAMARRE
+*
 * 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
@@ -133,3 +134,115 @@ char* getrelativefilename(char *currentDirectory, char *absoluteFilename)
 
        return relativeFilename;
 }
+
+wchar_t* getrelativefilenameW(wchar_t *currentDirectory, wchar_t *absoluteFilename)
+{
+       // declarations - put here so this should work in a C compiler
+       int afMarker = 0, rfMarker = 0;
+       int cdLen = 0, afLen = 0;
+       int i = 0;
+       int levels = 0;
+       wchar_t *relativeFilename= (wchar_t*)MALLOC(PATH_MAX*sizeof(wchar_t));
+
+       cdLen = (int)wcslen(currentDirectory);
+       afLen = (int)wcslen(absoluteFilename);
+
+       // make sure the names are not too short
+       if( cdLen < ABSOLUTE_NAME_START+1 || afLen < ABSOLUTE_NAME_START+1)
+       {
+               // fix bug 2181
+               wcscpy(relativeFilename, absoluteFilename);
+               return relativeFilename;
+       }
+
+       // Handle DOS names that are on different drives:
+       if(tolower(currentDirectory[0]) != tolower(absoluteFilename[0]))
+       {
+               // not on the same drive, so only absolute filename will do
+               wcscpy(relativeFilename, absoluteFilename);
+               return relativeFilename;
+       }
+
+       // they are on the same drive, find out how much of the current directory
+       // is in the absolute filename
+       i = ABSOLUTE_NAME_START;
+
+#if defined(_MSC_VER)
+       while(i < afLen && i < cdLen && tolower(currentDirectory[i])==tolower(absoluteFilename[i]) )
+       {
+               i++;
+       }
+#else
+       while(i < afLen && i < cdLen && currentDirectory[i] == absoluteFilename[i])
+       {
+               i++;
+       }
+#endif
+
+       if(i == cdLen && (absoluteFilename[i] == DIR_SEPARATOR[0] || absoluteFilename[i-1] == DIR_SEPARATOR[0]))
+       {
+               // the whole current directory name is in the file name,
+               // so we just trim off the current directory name to get the
+               // current file name.
+               if(absoluteFilename[i] == DIR_SEPARATOR[0])
+               {
+                       // a directory name might have a trailing slash but a relative
+                       // file name should not have a leading one...
+                       i++;
+               }
+
+               wcscpy(relativeFilename, &absoluteFilename[i]);
+               return relativeFilename;
+       }
+
+       // The file is not in a child directory of the current directory, so we
+       // need to step back the appropriate number of parent directories by
+       // using "..\"s.  First find out how many levels deeper we are than the
+       // common directory
+       afMarker = i;
+       levels = 1;
+
+       // count the number of directory levels we have to go up to get to the
+       // common directory
+       while(i < cdLen)
+       {
+               i++;
+               if(currentDirectory[i] == DIR_SEPARATOR[0])
+               {
+                       // make sure it's not a trailing slash
+                       i++;
+                       if(currentDirectory[i] != '\0')
+                       {
+                               levels++;
+                       }
+               }
+       }
+
+       // move the absolute filename marker back to the start of the directory name
+       // that it has stopped in.
+       while(afMarker > 0 && absoluteFilename[afMarker-1] != DIR_SEPARATOR[0])
+       {
+               afMarker--;
+       }
+
+       // check that the result will not be too long
+       if(levels * 3 + afLen - afMarker > PATH_MAX)
+       {
+               return NULL;
+       }
+
+       // add the appropriate number of "..\"s.
+       rfMarker = 0;
+       for(i = 0; i < levels; i++)
+       {
+               relativeFilename[rfMarker++] = '.';
+               relativeFilename[rfMarker++] = '.';
+               relativeFilename[rfMarker++] = DIR_SEPARATOR[0];
+       }
+
+       // copy the rest of the filename into the result string
+       wcscpy(&relativeFilename[rfMarker], &absoluteFilename[afMarker]);
+
+       return relativeFilename;
+}
+
index c534545..46d51b0 100644 (file)
@@ -1,6 +1,7 @@
 /*
 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
 * Copyright (C) 2006 - INRIA - Pierre MARECHAL
+* Copyright (C) 2011 - Digiteo - Cedric DELAMARRE
 * 
 * This file must be used under the terms of the CeCILL.
 * This source file is licensed as described in the file COPYING, which
@@ -34,6 +35,9 @@
 // GetRelativeFilename will return ..\whee\text.txt.
 /* ================================================================================== */
 
-char* getrelativefilename(char *currentDirectory, char *absoluteFilename);
+#include "wchar.h"
+#include "dynlib_fileio.h"
 
+char* getrelativefilename(char *currentDirectory, char *absoluteFilename);
+FILEIO_IMPEXP wchar_t* getrelativefilenameW(wchar_t *currentDirectory, wchar_t *absoluteFilename);
 #endif /* __GETRELATIVEFILENAME_H__ */
diff --git a/scilab/modules/fileio/src/c/mclearerr.c b/scilab/modules/fileio/src/c/mclearerr.c
deleted file mode 100644 (file)
index 1f41c86..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) 2007 - 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-en.txt
- *
- */
-/*--------------------------------------------------------------------------*/
-#include <stdio.h>
-#include "mclearerr.h"
-#include "filesmanagement.h"
-/*--------------------------------------------------------------------------*/
-void C2F(mclearerr) (int *fd)
-{       
-       FILE *fa= GetFileOpenedInScilab(*fd);
-       if (fa) clearerr(fa);
-}
-/*--------------------------------------------------------------------------*/
diff --git a/scilab/modules/fileio/src/c/mclearerr.h b/scilab/modules/fileio/src/c/mclearerr.h
deleted file mode 100644 (file)
index dbfc572..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) 2007 - 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-en.txt
- *
- */
-/*--------------------------------------------------------------------------*/
-#ifndef __MCLEARERR_H__
-#define __MCLEARERR_H__
-
-#include "machine.h"
-
-/**
-* clear errors 
-* @param fd
-*/
-void C2F(mclearerr) (int *fd);
-
-#endif /* __MCLEARERR_H__ */
-/*--------------------------------------------------------------------------*/
diff --git a/scilab/modules/fileio/src/c/merror.c b/scilab/modules/fileio/src/c/merror.c
deleted file mode 100644 (file)
index 6389882..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) 2007 - 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-en.txt
- *
- */
-/*--------------------------------------------------------------------------*/
-#include <stdio.h>
-#include <errno.h>
-#include "merror.h"
-#include "filesmanagement.h"
-/*--------------------------------------------------------------------------*/
-void C2F(merror) (int *fd, int *res)
-{       
-       FILE *fa= GetFileOpenedInScilab(*fd);
-       if (fa)
-       {
-
-               *res = ferror(fa);
-       }
-       else
-       {
-               *res = EINVAL;
-       }
-}
-/*--------------------------------------------------------------------------*/
-
diff --git a/scilab/modules/fileio/src/c/merror.h b/scilab/modules/fileio/src/c/merror.h
deleted file mode 100644 (file)
index fbbcef1..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) 2007 - 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-en.txt
- *
- */
-/*--------------------------------------------------------------------------*/
-#ifndef __MERROR_H__
-#define __MERROR_H__
-
-#include "machine.h"
-
-/**
- * check error
- *
- * @param fd    
- * @param res   
- */
-void C2F(merror) (int *fd, int *res);
-
-#endif /* __MERROR_H__ */
-/*--------------------------------------------------------------------------*/