bug 14821: getio function added. 43/18643/8
Adeline CARNIS [Fri, 28 Oct 2016 09:57:05 +0000 (11:57 +0200)]
Change-Id: If276355c3b69cc9d7b932bb63567f9905bf79de7

17 files changed:
scilab/CHANGES.md
scilab/modules/io/Makefile.am
scilab/modules/io/Makefile.in
scilab/modules/io/includes/gw_io.h
scilab/modules/io/includes/io_gw.hxx
scilab/modules/io/sci_gateway/c/sci_getio.c [deleted file]
scilab/modules/io/sci_gateway/cpp/sci_getio.cpp [new file with mode: 0644]
scilab/modules/io/sci_gateway/cpp/sci_lib.cpp
scilab/modules/io/src/cpp/io_gw.cpp
scilab/modules/io/src/cpp/io_gw.vcxproj
scilab/modules/io/src/cpp/io_gw.vcxproj.filters
scilab/modules/io/tests/nonreg_tests/bug_14821.dia.ref [new file with mode: 0644]
scilab/modules/io/tests/nonreg_tests/bug_14821.tst [new file with mode: 0644]
scilab/modules/output_stream/includes/DiaryModesEnum.hxx [moved from scilab/modules/output_stream/src/cpp/DiaryModesEnum.hxx with 100% similarity]
scilab/modules/output_stream/includes/diary_manager.hxx [moved from scilab/modules/output_stream/src/cpp/diary_manager.hxx with 98% similarity]
scilab/modules/output_stream/src/c/output_stream.vcxproj
scilab/modules/output_stream/src/c/output_stream.vcxproj.filters

index 486a23e..745bd9c 100644 (file)
@@ -374,6 +374,7 @@ Bug Fixes
 * [#14714](http://bugzilla.scilab.org/show_bug.cgi?id=14714): Crash/Leak when deleting datatip
 * [#14784](http://bugzilla.scilab.org/show_bug.cgi?id=14784): Setting field of graphics handle using children($) failed.
 * [#14796](http://bugzilla.scilab.org/show_bug.cgi?id=14796): `ind2sub(dims, [])` returns [] in version 6. Warnings due to a `[]+1` operation have been removed.
+* [#14821](http://bugzilla.scilab.org/show_bug.cgi?id=14821): `getio`function has been added. An error on the diary file opened has been corrected.
 
 ### Bugs fixed in 6.0.0 beta-2 and earlier 6.0.0 pre-releases:
 
index 5639aef..5cacb28 100644 (file)
@@ -18,7 +18,6 @@ IO_CPP_SOURCES = \
 
 GATEWAY_C_SOURCES = \
     sci_gateway/c/sci_read4b.c \
-    sci_gateway/c/sci_getio.c \
     sci_gateway/c/sci_readb.c \
     sci_gateway/c/sci_getenv.c \
     sci_gateway/c/sci_writeb.c \
@@ -33,7 +32,8 @@ GATEWAY_CPP_SOURCES = \
     sci_gateway/cpp/sci_unix.cpp \
     sci_gateway/cpp/sci_read.cpp \
     sci_gateway/cpp/sci_write.cpp \
-    sci_gateway/cpp/sci_lib.cpp
+    sci_gateway/cpp/sci_lib.cpp \
+    sci_gateway/cpp/sci_getio.cpp
 
 
 libsciio_la_CPPFLAGS = \
index eff1c19..adefd13 100644 (file)
@@ -193,7 +193,6 @@ am__v_lt_1 =
 @MAINTAINER_MODE_TRUE@am_libsciio_algo_la_rpath =
 libsciio_la_DEPENDENCIES = libsciio-algo.la
 am__objects_3 = sci_gateway/c/libsciio_la-sci_read4b.lo \
-       sci_gateway/c/libsciio_la-sci_getio.lo \
        sci_gateway/c/libsciio_la-sci_readb.lo \
        sci_gateway/c/libsciio_la-sci_getenv.lo \
        sci_gateway/c/libsciio_la-sci_writeb.lo \
@@ -206,7 +205,8 @@ am__objects_4 = sci_gateway/cpp/libsciio_la-sci_genlib.lo \
        sci_gateway/cpp/libsciio_la-sci_unix.lo \
        sci_gateway/cpp/libsciio_la-sci_read.lo \
        sci_gateway/cpp/libsciio_la-sci_write.lo \
-       sci_gateway/cpp/libsciio_la-sci_lib.lo
+       sci_gateway/cpp/libsciio_la-sci_lib.lo \
+       sci_gateway/cpp/libsciio_la-sci_getio.lo
 am_libsciio_la_OBJECTS = $(am__objects_3) $(am__objects_4)
 libsciio_la_OBJECTS = $(am_libsciio_la_OBJECTS)
 @MAINTAINER_MODE_FALSE@am_libsciio_la_rpath =
@@ -597,7 +597,6 @@ IO_CPP_SOURCES = \
 
 GATEWAY_C_SOURCES = \
     sci_gateway/c/sci_read4b.c \
-    sci_gateway/c/sci_getio.c \
     sci_gateway/c/sci_readb.c \
     sci_gateway/c/sci_getenv.c \
     sci_gateway/c/sci_writeb.c \
@@ -612,7 +611,8 @@ GATEWAY_CPP_SOURCES = \
     sci_gateway/cpp/sci_unix.cpp \
     sci_gateway/cpp/sci_read.cpp \
     sci_gateway/cpp/sci_write.cpp \
-    sci_gateway/cpp/sci_lib.cpp
+    sci_gateway/cpp/sci_lib.cpp \
+    sci_gateway/cpp/sci_getio.cpp
 
 libsciio_la_CPPFLAGS = \
     -I$(srcdir)/includes/ \
@@ -864,8 +864,6 @@ sci_gateway/c/$(DEPDIR)/$(am__dirstamp):
 sci_gateway/c/libsciio_la-sci_read4b.lo:  \
        sci_gateway/c/$(am__dirstamp) \
        sci_gateway/c/$(DEPDIR)/$(am__dirstamp)
-sci_gateway/c/libsciio_la-sci_getio.lo: sci_gateway/c/$(am__dirstamp) \
-       sci_gateway/c/$(DEPDIR)/$(am__dirstamp)
 sci_gateway/c/libsciio_la-sci_readb.lo: sci_gateway/c/$(am__dirstamp) \
        sci_gateway/c/$(DEPDIR)/$(am__dirstamp)
 sci_gateway/c/libsciio_la-sci_getenv.lo:  \
@@ -910,6 +908,9 @@ sci_gateway/cpp/libsciio_la-sci_write.lo:  \
 sci_gateway/cpp/libsciio_la-sci_lib.lo:  \
        sci_gateway/cpp/$(am__dirstamp) \
        sci_gateway/cpp/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/cpp/libsciio_la-sci_getio.lo:  \
+       sci_gateway/cpp/$(am__dirstamp) \
+       sci_gateway/cpp/$(DEPDIR)/$(am__dirstamp)
 
 libsciio.la: $(libsciio_la_OBJECTS) $(libsciio_la_DEPENDENCIES) $(EXTRA_libsciio_la_DEPENDENCIES) 
        $(AM_V_CXXLD)$(CXXLINK) $(am_libsciio_la_rpath) $(libsciio_la_OBJECTS) $(libsciio_la_LIBADD) $(LIBS)
@@ -929,7 +930,6 @@ distclean-compile:
        -rm -f *.tab.c
 
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/c/$(DEPDIR)/libsciio_la-sci_getenv.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/c/$(DEPDIR)/libsciio_la-sci_getio.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/c/$(DEPDIR)/libsciio_la-sci_getpid.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/c/$(DEPDIR)/libsciio_la-sci_read4b.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/c/$(DEPDIR)/libsciio_la-sci_readb.Plo@am__quote@
@@ -938,6 +938,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/c/$(DEPDIR)/libsciio_la-sci_writeb.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libsciio_la-sci_file.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libsciio_la-sci_genlib.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libsciio_la-sci_getio.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libsciio_la-sci_host.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libsciio_la-sci_lib.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libsciio_la-sci_read.Plo@am__quote@
@@ -1018,13 +1019,6 @@ sci_gateway/c/libsciio_la-sci_read4b.lo: sci_gateway/c/sci_read4b.c
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciio_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libsciio_la-sci_read4b.lo `test -f 'sci_gateway/c/sci_read4b.c' || echo '$(srcdir)/'`sci_gateway/c/sci_read4b.c
 
-sci_gateway/c/libsciio_la-sci_getio.lo: sci_gateway/c/sci_getio.c
-@am__fastdepCC_TRUE@   $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciio_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libsciio_la-sci_getio.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libsciio_la-sci_getio.Tpo -c -o sci_gateway/c/libsciio_la-sci_getio.lo `test -f 'sci_gateway/c/sci_getio.c' || echo '$(srcdir)/'`sci_gateway/c/sci_getio.c
-@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) sci_gateway/c/$(DEPDIR)/libsciio_la-sci_getio.Tpo sci_gateway/c/$(DEPDIR)/libsciio_la-sci_getio.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='sci_gateway/c/sci_getio.c' object='sci_gateway/c/libsciio_la-sci_getio.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciio_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libsciio_la-sci_getio.lo `test -f 'sci_gateway/c/sci_getio.c' || echo '$(srcdir)/'`sci_gateway/c/sci_getio.c
-
 sci_gateway/c/libsciio_la-sci_readb.lo: sci_gateway/c/sci_readb.c
 @am__fastdepCC_TRUE@   $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciio_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libsciio_la-sci_readb.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libsciio_la-sci_readb.Tpo -c -o sci_gateway/c/libsciio_la-sci_readb.lo `test -f 'sci_gateway/c/sci_readb.c' || echo '$(srcdir)/'`sci_gateway/c/sci_readb.c
 @am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) sci_gateway/c/$(DEPDIR)/libsciio_la-sci_readb.Tpo sci_gateway/c/$(DEPDIR)/libsciio_la-sci_readb.Plo
@@ -1161,6 +1155,13 @@ sci_gateway/cpp/libsciio_la-sci_lib.lo: sci_gateway/cpp/sci_lib.cpp
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciio_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o sci_gateway/cpp/libsciio_la-sci_lib.lo `test -f 'sci_gateway/cpp/sci_lib.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_lib.cpp
 
+sci_gateway/cpp/libsciio_la-sci_getio.lo: sci_gateway/cpp/sci_getio.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciio_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT sci_gateway/cpp/libsciio_la-sci_getio.lo -MD -MP -MF sci_gateway/cpp/$(DEPDIR)/libsciio_la-sci_getio.Tpo -c -o sci_gateway/cpp/libsciio_la-sci_getio.lo `test -f 'sci_gateway/cpp/sci_getio.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_getio.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_at)$(am__mv) sci_gateway/cpp/$(DEPDIR)/libsciio_la-sci_getio.Tpo sci_gateway/cpp/$(DEPDIR)/libsciio_la-sci_getio.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     $(AM_V_CXX)source='sci_gateway/cpp/sci_getio.cpp' object='sci_gateway/cpp/libsciio_la-sci_getio.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciio_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o sci_gateway/cpp/libsciio_la-sci_getio.lo `test -f 'sci_gateway/cpp/sci_getio.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_getio.cpp
+
 mostlyclean-libtool:
        -rm -f *.lo
 
index ec528a3..ca75129 100644 (file)
@@ -18,6 +18,8 @@
 /*--------------------------------------------------------------------------*/
 #include "machine.h"
 #include "dynlib_io.h"
+#include "c_gateway_prototype.h"
+
 /*--------------------------------------------------------------------------*/
 IO_IMPEXP int gw_io(void);
 /*--------------------------------------------------------------------------*/
@@ -36,7 +38,7 @@ int sci_read4b(char *fname, unsigned long fname_len);
 int sci_write4b(char *fname, unsigned long fname_len);
 int sci_save(char *fname, void *pvApiCtx);
 int sci_percent_load(char *fname, unsigned long fname_len);
-int sci_getio(char *fname, unsigned long fname_len);
+C_GATEWAY_PROTOTYPE(sci_getio);
 /*--------------------------------------------------------------------------*/
 #endif /* __GW_IO_H__ */
 /*--------------------------------------------------------------------------*/
index 5d58a14..691e86f 100644 (file)
@@ -42,6 +42,6 @@ CPP_GATEWAY_PROTOTYPE(sci_genlib);
 CPP_GATEWAY_PROTOTYPE(sci_file);
 CPP_GATEWAY_PROTOTYPE(sci_host);
 CPP_GATEWAY_PROTOTYPE(sci_unix);
-CPP_GATEWAY_PROTOTYPE(sci_lib);
+CPP_GATEWAY_PROTOTYPE(sci_gwlib);
 CPP_GATEWAY_PROTOTYPE(sci_write);
 CPP_GATEWAY_PROTOTYPE(sci_read);
diff --git a/scilab/modules/io/sci_gateway/c/sci_getio.c b/scilab/modules/io/sci_gateway/c/sci_getio.c
deleted file mode 100644 (file)
index 28d4e6a..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) 2007 - INRIA - Allan CORNET
- *
- * Copyright (C) 2012 - 2016 - Scilab Enterprises
- *
- * This file is hereby licensed under the terms of the GNU GPL v2.0,
- * pursuant to article 5.3.4 of the CeCILL v.2.1.
- * This file was originally licensed under the terms of the CeCILL v2.1,
- * and continues to be available under such terms.
- * For more information, see the COPYING file which you should have received
- * along with this program.
- *
- */
-
-#include "gw_io.h"
-#include "sci_malloc.h"
-/*--------------------------------------------------------------------------*/
-int sci_getio(char *fname, unsigned long fname_len)
-{
-    //int one = 1;
-    //int four = 4;
-    //int *values = NULL;
-
-    //CheckRhs(0, 0);
-    //CheckLhs(0, 1);
-
-    //values = (int*)MALLOC(sizeof(int) * (one * four));
-
-    //values[0] =  C2F(iop).rio;
-    //values[1] =  C2F(iop).rte;
-    //values[2] =  0;
-    //values[3] =  C2F(iop).wte;
-
-    //CreateVarFromPtr(Rhs + 1, MATRIX_OF_INTEGER_DATATYPE, &one, &four, &values);
-    //LhsVar(1) = Rhs + 1;
-    //if (values)
-    //{
-    //    FREE(values);
-    //    values = NULL;
-    //}
-    //PutLhsVar();
-
-    return 0;
-}
-/*--------------------------------------------------------------------------*/
diff --git a/scilab/modules/io/sci_gateway/cpp/sci_getio.cpp b/scilab/modules/io/sci_gateway/cpp/sci_getio.cpp
new file mode 100644 (file)
index 0000000..5bbb066
--- /dev/null
@@ -0,0 +1,61 @@
+/*
+* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+* Copyright (C) 2007 - INRIA - Allan CORNET
+* Copyright (C) 2016 - Scilab Enterprises - Adeline CARNIS
+*
+* Copyright (C) 2012 - 2016 - Scilab Enterprises
+*
+* This file is hereby licensed under the terms of the GNU GPL v2.0,
+* pursuant to article 5.3.4 of the CeCILL v.2.1.
+* This file was originally licensed under the terms of the CeCILL v2.1,
+* and continues to be available under such terms.
+* For more information, see the COPYING file which you should have received
+* along with this program.
+*
+*/
+/*--------------------------------------------------------------------------*/
+#include "diary_manager.hxx"
+#include <vector>
+
+extern "C"
+{
+#include "gw_io.h"
+#include "api_scilab.h"
+#include "Scierror.h"
+#include "localization.h"
+#include "gw_output_stream.h"
+}
+
+static const char fname[] = "getio";
+/*--------------------------------------------------------------------------*/
+int sci_getio(scilabEnv env, int nin, scilabVar* in, int nopt, scilabOpt opt, int nout, scilabVar* out)
+{
+
+       if (nin != 0)
+       {
+               Scierror(77, _("%s: Wrong number of input argument(s): %d expected.\n"), fname, 0);
+               return 1;
+       }
+
+       if (nout != 1)
+       {
+               Scierror(78, _("%s: Wrong number of output argument(s): %d expected.\n"), fname, 1);
+               return 1;
+       }
+
+    //get diarys count
+    int diary = 0;
+    int* diarys = getDiaryIDs(&diary);
+    //don't care about ids
+    delete[] diarys;
+
+    //create data values array
+    std::vector<double> val = {5, 5, (double)diary, 6};
+    //create output matrix
+    scilabVar var = scilab_createDoubleMatrix2d(env, 1, 4, 0);
+    //fill it
+    scilab_setDoubleArray(env, var, val.data());
+    //return it to scilab
+    out[0] = var;
+       return 0;
+}
\ No newline at end of file
index 3282383..dd08cde 100644 (file)
@@ -28,7 +28,7 @@ extern "C"
 }
 
 /*--------------------------------------------------------------------------*/
-types::Function::ReturnValue sci_lib(types::typed_list &in, int /*_iRetCount*/, types::typed_list &out)
+types::Function::ReturnValue sci_gwlib(types::typed_list &in, int /*_iRetCount*/, types::typed_list &out)
 {
     if (in.size() != 1)
     {
index c149f7d..7526289 100644 (file)
@@ -30,8 +30,9 @@ int IoModule::Load()
     symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"unix", &sci_unix, MODULE_NAME));
     symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"getenv", &sci_getenv, MODULE_NAME));
     symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"setenv", &sci_setenv, MODULE_NAME));
-    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"lib", &sci_lib, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"lib", &sci_gwlib, MODULE_NAME));
     symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"write", &sci_write, MODULE_NAME));
     symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"read", &sci_read, MODULE_NAME));
+       symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"getio", &sci_getio, MODULE_NAME));
     return 1;
 }
index 4a1c691..697aa96 100644 (file)
     </PreLinkEvent>
   </ItemDefinitionGroup>
   <ItemGroup>
+    <ClCompile Include="..\..\sci_gateway\cpp\sci_getio.cpp" />
     <ClCompile Include="..\..\sci_gateway\cpp\sci_lib.cpp" />
     <ClCompile Include="..\..\sci_gateway\cpp\sci_read.cpp" />
     <ClCompile Include="..\..\sci_gateway\cpp\sci_write.cpp" />
     <ClCompile Include="..\..\sci_gateway\c\sci_getenv.c" />
-    <ClCompile Include="..\..\sci_gateway\c\sci_getio.c" />
     <ClCompile Include="..\..\sci_gateway\c\sci_getpid.c" />
     <ClCompile Include="..\..\sci_gateway\c\sci_read4b.c" />
     <ClCompile Include="..\..\sci_gateway\c\sci_readb.c" />
index cbe18df..c461da9 100644 (file)
@@ -39,9 +39,6 @@
     <ClCompile Include="..\..\sci_gateway\c\sci_writeb.c">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\sci_gateway\c\sci_getio.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
     <ClCompile Include="..\..\sci_gateway\c\sci_getpid.c">
       <Filter>Source Files</Filter>
     </ClCompile>
@@ -69,6 +66,9 @@
     <ClCompile Include="readwrite.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\sci_gateway\cpp\sci_getio.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\..\includes\dynlib_io_gw.h">
diff --git a/scilab/modules/io/tests/nonreg_tests/bug_14821.dia.ref b/scilab/modules/io/tests/nonreg_tests/bug_14821.dia.ref
new file mode 100644 (file)
index 0000000..2f4fa33
--- /dev/null
@@ -0,0 +1,28 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2016 - Scilab Enterprises - Adeline CARNIS
+//
+//  This file is distributed under the same license as the Scilab package.
+// =============================================================================
+// <-- Non-regression test for bug 14821 -->
+//
+// <-- Bugzilla URL -->
+// http://bugzilla.scilab.org/14821
+//
+// <-- Short Description -->
+// getio function has been added.
+// WARNING: a diary file opened with test_run !
+res = getio();
+assert_checkequal(res, [5 5 1 6]);
+a = diary(fullfile("TMPDIR", "diary.txt"));
+res = getio();
+assert_checkequal(res, [5 5 2 6]);
+// error
+str = "getio(1)";
+assert_checkfalse(execstr(str   ,"errcatch") == 0);
+refMsg = msprintf(_("%s: Wrong number of input argument(s): %d expected.\n"), "getio", 0);
+assert_checkerror(str, refMsg);
+str = "[a,b] = getio()";
+assert_checkfalse(execstr(str   ,"errcatch") == 0);
+refMsg = msprintf(_("%s: Wrong number of output argument(s): %d expected.\n"), "getio", 1);
+assert_checkerror(str, refMsg);
diff --git a/scilab/modules/io/tests/nonreg_tests/bug_14821.tst b/scilab/modules/io/tests/nonreg_tests/bug_14821.tst
new file mode 100644 (file)
index 0000000..be2a77d
--- /dev/null
@@ -0,0 +1,35 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2016 - Scilab Enterprises - Adeline CARNIS
+//
+//  This file is distributed under the same license as the Scilab package.
+// =============================================================================
+
+// <-- Non-regression test for bug 14821 -->
+//
+// <-- Bugzilla URL -->
+// http://bugzilla.scilab.org/14821
+//
+// <-- Short Description -->
+// getio function has been added.
+
+// WARNING: a diary file opened with test_run !
+res = getio();
+assert_checkequal(res, [5 5 1 6]);
+
+a = diary(fullfile("TMPDIR", "diary.txt"));
+res = getio();
+assert_checkequal(res, [5 5 2 6]);
+
+// error
+str = "getio(1)";
+assert_checkfalse(execstr(str   ,"errcatch") == 0);
+refMsg = msprintf(_("%s: Wrong number of input argument(s): %d expected.\n"), "getio", 0);
+assert_checkerror(str, refMsg);
+
+str = "[a,b] = getio()";
+assert_checkfalse(execstr(str   ,"errcatch") == 0);
+refMsg = msprintf(_("%s: Wrong number of output argument(s): %d expected.\n"), "getio", 1);
+assert_checkerror(str, refMsg);
+
+
@@ -42,7 +42,7 @@ OUTPUT_STREAM_IMPEXP wchar_t **getDiaryFilenames(int *array_size);
 * @param[out] size of returned array
 * @return IDs
 */
-int *getDiaryIDs(int *array_size);
+OUTPUT_STREAM_IMPEXP int *getDiaryIDs(int *array_size);
 
 /**
 * get all IDs in manager
index 913b2ed..31ed81f 100644 (file)
@@ -256,6 +256,8 @@ lib /DEF:"$(ProjectDir)Fileio_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform
     <ClInclude Include="..\..\includes\basout.h" />
     <ClInclude Include="..\..\includes\cerro.h" />
     <ClInclude Include="..\..\includes\diary.h" />
+    <ClInclude Include="..\..\includes\DiaryModesEnum.hxx" />
+    <ClInclude Include="..\..\includes\diary_manager.hxx" />
     <ClInclude Include="..\..\includes\do_error_number.h" />
     <ClInclude Include="..\..\includes\dynlib_output_stream.h" />
     <ClInclude Include="..\..\includes\erro.h" />
@@ -269,8 +271,6 @@ lib /DEF:"$(ProjectDir)Fileio_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform
     <ClInclude Include="..\..\includes\Sciwarning.h" />
     <ClInclude Include="..\cpp\Diary.hxx" />
     <ClInclude Include="..\cpp\DiaryList.hxx" />
-    <ClInclude Include="..\cpp\DiaryModesEnum.hxx" />
-    <ClInclude Include="..\cpp\diary_manager.hxx" />
     <ClInclude Include="..\cpp\getDiaryDate.hxx" />
     <ClInclude Include="..\cpp\getUniqueFilename.hxx" />
     <ClInclude Include="errorTable.h" />
index ecda6fd..703a612 100644 (file)
     <ClInclude Include="..\cpp\Diary.hxx">
       <Filter>Header Files</Filter>
     </ClInclude>
-    <ClInclude Include="..\cpp\diary_manager.hxx">
-      <Filter>Header Files</Filter>
-    </ClInclude>
     <ClInclude Include="..\cpp\DiaryList.hxx">
       <Filter>Header Files</Filter>
     </ClInclude>
-    <ClInclude Include="..\cpp\DiaryModesEnum.hxx">
-      <Filter>Header Files</Filter>
-    </ClInclude>
     <ClInclude Include="..\cpp\getDiaryDate.hxx">
       <Filter>Header Files</Filter>
     </ClInclude>
     <ClInclude Include="..\..\includes\Sciwarning.h">
       <Filter>Header Files</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\includes\diary_manager.hxx">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\includes\DiaryModesEnum.hxx">
+      <Filter>Header Files</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <None Include="core_import.def">