getlongpathname & fullpath enabled within YaSp. 76/2876/3
Bruno JOFRET [Fri, 7 Jan 2011 17:35:13 +0000 (18:35 +0100)]
Change-Id: Ibff3b4c9bde6dfa5d82738e1951023f3ee9a8d0b

scilab/modules/fileio/Makefile.am
scilab/modules/fileio/Makefile.in
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_fullpath.cpp [new file with mode: 0644]
scilab/modules/fileio/sci_gateway/cpp/sci_getlongpathname.cpp [new file with mode: 0644]
scilab/modules/fileio/src/c/getlongpathname.h

index aedb532..d597b19 100644 (file)
@@ -61,9 +61,7 @@ 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_fullpath.c \
 sci_gateway/c/sci_pathsep.c \
-sci_gateway/c/sci_getlongpathname.c \
 sci_gateway/c/sci_removedir.c \
 sci_gateway/c/sci_chdir.c \
 sci_gateway/c/sci_pwd.c \
@@ -98,8 +96,10 @@ GATEWAY_CPP_SOURCES = \
        sci_gateway/cpp/sci_isfile.cpp \
        sci_gateway/cpp/sci_deletefile.cpp \
        sci_gateway/cpp/sci_getshortpathname.cpp \
+       sci_gateway/cpp/sci_getlongpathname.cpp \
        sci_gateway/cpp/sci_fileext.cpp \
-       sci_gateway/cpp/sci_createdir.cpp
+       sci_gateway/cpp/sci_createdir.cpp \
+       sci_gateway/cpp/sci_fullpath.cpp
 
 
 FILEIO_CPP_SOURCES = \
index cb0baef..302565a 100644 (file)
@@ -159,8 +159,7 @@ am__objects_3 = libscifileio_la-gw_fileio.lo \
        libscifileio_la-sci_fscanfMat.lo \
        libscifileio_la-sci_maxfiles.lo \
        libscifileio_la-sci_getdrives.lo \
-       libscifileio_la-sci_fullpath.lo libscifileio_la-sci_pathsep.lo \
-       libscifileio_la-sci_getlongpathname.lo \
+       libscifileio_la-sci_pathsep.lo \
        libscifileio_la-sci_removedir.lo libscifileio_la-sci_chdir.lo \
        libscifileio_la-sci_pwd.lo libscifileio_la-sci_mclearerr.lo \
        libscifileio_la-sci_merror.lo libscifileio_la-sci_mgetstr.lo \
@@ -183,8 +182,10 @@ am__objects_4 = libscifileio_la-fileio_gw.lo \
        libscifileio_la-sci_fileinfo.lo libscifileio_la-sci_isfile.lo \
        libscifileio_la-sci_deletefile.lo \
        libscifileio_la-sci_getshortpathname.lo \
+       libscifileio_la-sci_getlongpathname.lo \
        libscifileio_la-sci_fileext.lo \
-       libscifileio_la-sci_createdir.lo
+       libscifileio_la-sci_createdir.lo \
+       libscifileio_la-sci_fullpath.lo
 am_libscifileio_la_OBJECTS = $(am__objects_1) $(am__objects_2) \
        $(am__objects_3) $(am__objects_4)
 libscifileio_la_OBJECTS = $(am_libscifileio_la_OBJECTS)
@@ -528,9 +529,7 @@ 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_fullpath.c \
 sci_gateway/c/sci_pathsep.c \
-sci_gateway/c/sci_getlongpathname.c \
 sci_gateway/c/sci_removedir.c \
 sci_gateway/c/sci_chdir.c \
 sci_gateway/c/sci_pwd.c \
@@ -565,8 +564,10 @@ GATEWAY_CPP_SOURCES = \
        sci_gateway/cpp/sci_isfile.cpp \
        sci_gateway/cpp/sci_deletefile.cpp \
        sci_gateway/cpp/sci_getshortpathname.cpp \
+       sci_gateway/cpp/sci_getlongpathname.cpp \
        sci_gateway/cpp/sci_fileext.cpp \
-       sci_gateway/cpp/sci_createdir.cpp
+       sci_gateway/cpp/sci_createdir.cpp \
+       sci_gateway/cpp/sci_fullpath.cpp
 
 FILEIO_CPP_SOURCES = \
        src/cpp/expandPathVariable.cpp \
@@ -1278,13 +1279,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_fullpath.lo: sci_gateway/c/sci_fullpath.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_fullpath.lo -MD -MP -MF $(DEPDIR)/libscifileio_la-sci_fullpath.Tpo -c -o libscifileio_la-sci_fullpath.lo `test -f 'sci_gateway/c/sci_fullpath.c' || echo '$(srcdir)/'`sci_gateway/c/sci_fullpath.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscifileio_la-sci_fullpath.Tpo $(DEPDIR)/libscifileio_la-sci_fullpath.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/sci_fullpath.c' object='libscifileio_la-sci_fullpath.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_fullpath.lo `test -f 'sci_gateway/c/sci_fullpath.c' || echo '$(srcdir)/'`sci_gateway/c/sci_fullpath.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
@@ -1292,13 +1286,6 @@ libscifileio_la-sci_pathsep.lo: sci_gateway/c/sci_pathsep.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_pathsep.lo `test -f 'sci_gateway/c/sci_pathsep.c' || echo '$(srcdir)/'`sci_gateway/c/sci_pathsep.c
 
-libscifileio_la-sci_getlongpathname.lo: sci_gateway/c/sci_getlongpathname.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_getlongpathname.lo -MD -MP -MF $(DEPDIR)/libscifileio_la-sci_getlongpathname.Tpo -c -o libscifileio_la-sci_getlongpathname.lo `test -f 'sci_gateway/c/sci_getlongpathname.c' || echo '$(srcdir)/'`sci_gateway/c/sci_getlongpathname.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscifileio_la-sci_getlongpathname.Tpo $(DEPDIR)/libscifileio_la-sci_getlongpathname.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/sci_getlongpathname.c' object='libscifileio_la-sci_getlongpathname.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_getlongpathname.lo `test -f 'sci_gateway/c/sci_getlongpathname.c' || echo '$(srcdir)/'`sci_gateway/c/sci_getlongpathname.c
-
 libscifileio_la-sci_removedir.lo: sci_gateway/c/sci_removedir.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_removedir.lo -MD -MP -MF $(DEPDIR)/libscifileio_la-sci_removedir.Tpo -c -o libscifileio_la-sci_removedir.lo `test -f 'sci_gateway/c/sci_removedir.c' || echo '$(srcdir)/'`sci_gateway/c/sci_removedir.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscifileio_la-sci_removedir.Tpo $(DEPDIR)/libscifileio_la-sci_removedir.Plo
@@ -1600,6 +1587,13 @@ libscifileio_la-sci_getshortpathname.lo: sci_gateway/cpp/sci_getshortpathname.cp
 @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_getshortpathname.lo `test -f 'sci_gateway/cpp/sci_getshortpathname.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_getshortpathname.cpp
 
+libscifileio_la-sci_getlongpathname.lo: sci_gateway/cpp/sci_getlongpathname.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_getlongpathname.lo -MD -MP -MF $(DEPDIR)/libscifileio_la-sci_getlongpathname.Tpo -c -o libscifileio_la-sci_getlongpathname.lo `test -f 'sci_gateway/cpp/sci_getlongpathname.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_getlongpathname.cpp
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscifileio_la-sci_getlongpathname.Tpo $(DEPDIR)/libscifileio_la-sci_getlongpathname.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='sci_gateway/cpp/sci_getlongpathname.cpp' object='libscifileio_la-sci_getlongpathname.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_getlongpathname.lo `test -f 'sci_gateway/cpp/sci_getlongpathname.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_getlongpathname.cpp
+
 libscifileio_la-sci_fileext.lo: sci_gateway/cpp/sci_fileext.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_fileext.lo -MD -MP -MF $(DEPDIR)/libscifileio_la-sci_fileext.Tpo -c -o libscifileio_la-sci_fileext.lo `test -f 'sci_gateway/cpp/sci_fileext.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_fileext.cpp
 @am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscifileio_la-sci_fileext.Tpo $(DEPDIR)/libscifileio_la-sci_fileext.Plo
@@ -1614,6 +1608,13 @@ libscifileio_la-sci_createdir.lo: sci_gateway/cpp/sci_createdir.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_createdir.lo `test -f 'sci_gateway/cpp/sci_createdir.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_createdir.cpp
 
+libscifileio_la-sci_fullpath.lo: sci_gateway/cpp/sci_fullpath.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_fullpath.lo -MD -MP -MF $(DEPDIR)/libscifileio_la-sci_fullpath.Tpo -c -o libscifileio_la-sci_fullpath.lo `test -f 'sci_gateway/cpp/sci_fullpath.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_fullpath.cpp
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscifileio_la-sci_fullpath.Tpo $(DEPDIR)/libscifileio_la-sci_fullpath.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='sci_gateway/cpp/sci_fullpath.cpp' object='libscifileio_la-sci_fullpath.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_fullpath.lo `test -f 'sci_gateway/cpp/sci_fullpath.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_fullpath.cpp
+
 mostlyclean-libtool:
        -rm -f *.lo
 
index 7bf3f62..d4f1bcb 100644 (file)
@@ -1,13 +1,13 @@
 /*
  *  Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- *  Copyright (C) 2010-2010 - DIGITEO - Bruno JOFRET
- * 
+ *  Copyright (C) 2010-2011 - DIGITEO - Bruno JOFRET
+ *
  *  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 __FILEIO_GW_HXX__
@@ -23,7 +23,7 @@
                #define EXTERN_FILEIO_GW __declspec (dllimport)
        #endif
 #else
-       #define EXTERN_FILEIO_GW 
+       #define EXTERN_FILEIO_GW
 #endif
 
 class FileioModule
@@ -52,7 +52,9 @@ CPP_GATEWAY_PROTOTYPE(sci_isfile);
 CPP_GATEWAY_PROTOTYPE(sci_fileinfo);
 CPP_GATEWAY_PROTOTYPE(sci_deletefile);
 CPP_GATEWAY_PROTOTYPE(sci_getshortpathname);
+CPP_GATEWAY_PROTOTYPE(sci_getlongpathname);
 CPP_GATEWAY_PROTOTYPE(sci_fileext);
 CPP_GATEWAY_PROTOTYPE(sci_createdir);
+CPP_GATEWAY_PROTOTYPE(sci_fullpath);
 
 #endif /* !__FILEIO_GW_HXX__ */
index 95241c2..7fc9ff2 100644 (file)
@@ -30,9 +30,7 @@ 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_fullpath(char *fname,unsigned long fname_len);
 FILEIO_IMPEXP int sci_pathsep(char *fname,unsigned long fname_len);
-FILEIO_IMPEXP int sci_getlongpathname(char *fname,unsigned long fname_len);
 FILEIO_IMPEXP int sci_removedir(char *fname,unsigned long fname_len);
 FILEIO_IMPEXP int sci_newest(char *fname,unsigned long fname_len);
 FILEIO_IMPEXP int sci_getrelativefilename(char *fname, unsigned long l);
index 2d04e39..c3ece87 100644 (file)
@@ -2,11 +2,11 @@
  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
  * Copyright (C) 2006 - INRIA - Allan CORNET
  * Copyright (C) 2010 - DIGITEO - Allan CORNET
- * 
+ *
  * This file must be used under the terms of the CeCILL.
  * This source file is licensed as described in the file COPYING, which
  * you should have received as part of this distribution.  The terms
- * are also available at    
+ * are also available at
  * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
  *
  */
@@ -15,9 +15,9 @@
 #include "callFunctionFromGateway.h"
 #include "MALLOC.h"
 #include "stack-c.h"
-/*--------------------------------------------------------------------------*/ 
+/*--------------------------------------------------------------------------*/
 /*  interface function */
-/*--------------------------------------------------------------------------*/ 
+/*--------------------------------------------------------------------------*/
 static gw_generic_table Tab[]={
        {NULL, ""}, //mopen
        {sci_mputstr, "mputstr"},
@@ -39,11 +39,11 @@ static gw_generic_table Tab[]={
        {NULL, ""}, //findfiles
        {sci_maxfiles,"maxfiles"},
        {sci_getdrives,"getdrives"},
-       {sci_fullpath,"fullpath"},
+       {NULL, ""}, // fullpath
        {NULL, ""}, //deletefile
        {sci_pathsep,"pathsep"},
        {NULL, ""}, //filesep
-       {sci_getlongpathname,"getlongpathname"},
+       {NULL, ""}, // getlongpathname
        {NULL ,""}, //getshortpathname
        {NULL, ""}, //fileext
        {NULL, ""}, //isdir
@@ -63,7 +63,7 @@ static gw_generic_table Tab[]={
        {NULL, ""}, //pathconvert
        {NULL, ""} //cd
        };
-/*--------------------------------------------------------------------------*/ 
+/*--------------------------------------------------------------------------*/
 int gw_fileio(void)
 {
     Rhs = Max(0,Rhs);
@@ -71,5 +71,5 @@ int gw_fileio(void)
     callFunctionFromGateway(Tab, SIZE_CURRENT_GENERIC_TABLE(Tab));
     return 0;
 }
-/*--------------------------------------------------------------------------*/ 
+/*--------------------------------------------------------------------------*/
 
index 131a82c..cd8cff9 100644 (file)
@@ -1,13 +1,13 @@
 /*
  *  Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
  *  Copyright (C) 2010-2010 - DIGITEO - Bruno JOFRET
- * 
+ *
  *  This file must be used under the terms of the CeCILL.
  *  This source file is licensed as described in the file COPYING, which
  *  you should have received as part of this distribution.  The terms
  *  are also available at
  *  http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
- * 
+ *
  */
 
 #include "fileio_gw.hxx"
@@ -42,7 +42,9 @@ bool FileioModule::Load()
     symbol::Context::getInstance()->AddFunction(Function::createFunction(L"fileinfo", &sci_fileinfo, MODULE_NAME));
     symbol::Context::getInstance()->AddFunction(Function::createFunction(L"deletefile", &sci_deletefile, MODULE_NAME));
     symbol::Context::getInstance()->AddFunction(Function::createFunction(L"getshortpathname", &sci_getshortpathname, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(Function::createFunction(L"getlongpathname", &sci_getlongpathname, MODULE_NAME));
     symbol::Context::getInstance()->AddFunction(Function::createFunction(L"fileext", &sci_fileext, MODULE_NAME));
     symbol::Context::getInstance()->AddFunction(Function::createFunction(L"createdir", &sci_createdir, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(Function::createFunction(L"fullpath", &sci_fullpath, MODULE_NAME));
     return true;
 }
index 08e98e0..4602061 100644 (file)
                                >
                        </File>
                        <File
+                               RelativePath=".\sci_fullpath.cpp"
+                               >
+                       </File>
+                       <File
+                               RelativePath=".\sci_getlongpathname.cpp"
+                               >
+                       </File>
+                       <File
                                RelativePath=".\sci_getshortpathname.cpp"
                                >
                        </File>
diff --git a/scilab/modules/fileio/sci_gateway/cpp/sci_fullpath.cpp b/scilab/modules/fileio/sci_gateway/cpp/sci_fullpath.cpp
new file mode 100644 (file)
index 0000000..3acd9fc
--- /dev/null
@@ -0,0 +1,62 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2011 - 2011 - DIGITEO - Bruno JOFRET
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution.  The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ *
+ */
+/*--------------------------------------------------------------------------*/
+#include "fileio_gw.hxx"
+#include "function.hxx"
+#include "string.hxx"
+
+extern "C"
+{
+#include "fullpath.h"
+#include "Scierror.h"
+#include "localization.h"
+#include "PATH_MAX.h"
+}
+/*--------------------------------------------------------------------------*/
+
+using namespace types;
+
+Function::ReturnValue sci_fullpath(typed_list &in, int _iRetCount, typed_list &out)
+{
+    if(in.size() != 1)
+    {
+        ScierrorW(999, _W("%ls: Wrong number of input arguments: %d expected.\n"), L"fullpath" , 1);
+        return Function::Error;
+    }
+
+    if(_iRetCount != 1)
+    {
+        ScierrorW(78, _W("%ls: Wrong number of output argument(s): %d expected.\n"), L"fullpath", 1);
+        return Function::Error;
+    }
+
+    if(in[0]->isString() == false || in[0]->getAs<String>()->size_get() != 1)
+    {
+        ScierrorW(999, _W("%ls: Wrong type for input argument #%d: A String expected.\n"), L"fullpath", 1);
+        return Function::Error;
+    }
+
+    wchar_t *relPath = in[0]->getAs<String>()->string_get(0);
+    wchar_t fullpath[PATH_MAX*4];
+
+    if( get_full_pathW( fullpath, relPath, PATH_MAX*4 ) != NULL )
+    {
+        out.push_back(new String(fullpath));
+        return Function::OK;
+    }
+    else
+    {
+        ScierrorW(999,_W("%ls: Wrong value for input argument #%d: '%ls' is an invalid path.\n"), L"fullpath", 1 , relPath);
+        return Function::Error;
+    }
+}
+/*--------------------------------------------------------------------------*/
diff --git a/scilab/modules/fileio/sci_gateway/cpp/sci_getlongpathname.cpp b/scilab/modules/fileio/sci_gateway/cpp/sci_getlongpathname.cpp
new file mode 100644 (file)
index 0000000..2f960e5
--- /dev/null
@@ -0,0 +1,70 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2011 - DIGITEO - Bruno JOFRET
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution.  The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ *
+ */
+/*--------------------------------------------------------------------------*/
+#include "fileio_gw.hxx"
+#include "function.hxx"
+#include "bool.hxx"
+#include "string.hxx"
+
+extern "C"
+{
+#include "getlongpathname.h"
+#include "Scierror.h"
+#include "localization.h"
+}
+/*--------------------------------------------------------------------------*/
+
+using namespace types;
+
+Function::ReturnValue sci_getlongpathname(typed_list &in, int _iRetCount, typed_list &out)
+{
+    if(in.size() != 1)
+    {
+        ScierrorW(999, _W("%ls: Wrong number of input arguments: %d expected.\n"), L"getlongpathname" , 1);
+        return Function::Error;
+    }
+
+    if(_iRetCount != 1 && _iRetCount != 2)
+    {
+        ScierrorW(78, _W("%ls: Wrong number of output argument(s): %d to %d expected.\n"), L"getlongpathname", 1, 2);
+        return Function::Error;
+    }
+
+    if(in[0]->isString() == false)
+    {
+        ScierrorW(999, _W("%ls: Wrong type for input argument #%d: Matrix of strings expected.\n"), L"getlongpathname", 1);
+        return Function::Error;
+    }
+
+    String* pS  = in[0]->getAs<String>();
+
+    String* pOut1 = new String(pS->rows_get() , pS->cols_get());
+    Bool* pOut2 = new Bool(pS->rows_get() , pS->cols_get());
+    int* pBool = pOut2->bool_get();
+    for(int i = 0 ; i < pS->size_get(); i++)
+    {
+        pOut1->string_set(i, getlongpathnameW(pS->string_get(i), &pBool[i]));
+    }
+
+    out.push_back(pOut1);
+    if(_iRetCount == 2)
+    {
+        out.push_back(pOut2);
+    }
+    else
+    {
+        delete pOut2;
+    }
+
+    return Function::OK;
+}
+/*--------------------------------------------------------------------------*/
index c8a6eec..c03444b 100644 (file)
@@ -15,6 +15,7 @@
 
 #include <wchar.h>
 #include "BOOL.h" /* BOOL */
+#include "dynlib_fileio.h"
 
 /**
 * Retrieves the long path form of the specified path
@@ -34,7 +35,7 @@ char *getlongpathname(char *shortpathname,BOOL *convertok);
 * on Linux returns same path name
 * used for Windows
 */
-wchar_t *getlongpathnameW(wchar_t *wcshortpathname,BOOL *convertok);
+FILEIO_IMPEXP wchar_t *getlongpathnameW(wchar_t *wcshortpathname,BOOL *convertok);
 
 
 #endif /* __GETLONGPATHNAME_H__ */