summaryrefslogtreecommitdiffstats
path: root/scilab/modules/io
diff options
context:
space:
mode:
authorSylvestre Ledru <sylvestre.ledru@scilab.org>2010-02-02 16:50:46 +0100
committerSylvestre Ledru <sylvestre.ledru@scilab.org>2010-02-02 16:50:46 +0100
commit4543a005198ee3197c08e553378430c9bc590911 (patch)
treef48aacd7ed42e1a1b0f13d95fa7185fe4b6afde7 /scilab/modules/io
parent7262c7b88b413c8a0b09bb0a627d613cdca3f845 (diff)
parent97de4eee52d09735f550d4c632fba106d0cc1762 (diff)
downloadscilab-4543a005198ee3197c08e553378430c9bc590911.zip
scilab-4543a005198ee3197c08e553378430c9bc590911.tar.gz
Merge remote branch 'origin/master' into textrendering
Conflicts: scilab/configure
Diffstat (limited to 'scilab/modules/io')
-rw-r--r--scilab/modules/io/Makefile.in4
-rw-r--r--scilab/modules/io/sci_gateway/c/sci_file.c335
-rw-r--r--scilab/modules/io/src/c/io.vcproj4
-rw-r--r--scilab/modules/io/src/fortran/io_f.vfproj4
-rw-r--r--scilab/modules/io/tests/unit_tests/file.dia.ref47
-rw-r--r--scilab/modules/io/tests/unit_tests/file.tst48
6 files changed, 437 insertions, 5 deletions
diff --git a/scilab/modules/io/Makefile.in b/scilab/modules/io/Makefile.in
index 5344f3a..a797d2f 100644
--- a/scilab/modules/io/Makefile.in
+++ b/scilab/modules/io/Makefile.in
@@ -184,6 +184,7 @@ AVALON_FRAMEWORK = @AVALON_FRAMEWORK@
184AWK = @AWK@ 184AWK = @AWK@
185BATIK = @BATIK@ 185BATIK = @BATIK@
186BLAS_LIBS = @BLAS_LIBS@ 186BLAS_LIBS = @BLAS_LIBS@
187BSH = @BSH@
187CC = @CC@ 188CC = @CC@
188CCDEPMODE = @CCDEPMODE@ 189CCDEPMODE = @CCDEPMODE@
189CFLAGS = @CFLAGS@ 190CFLAGS = @CFLAGS@
@@ -257,6 +258,7 @@ JLATEXMATH_FOP = @JLATEXMATH_FOP@
257JOGL = @JOGL@ 258JOGL = @JOGL@
258JROSETTA_API = @JROSETTA_API@ 259JROSETTA_API = @JROSETTA_API@
259JROSETTA_ENGINE = @JROSETTA_ENGINE@ 260JROSETTA_ENGINE = @JROSETTA_ENGINE@
261JUNIT = @JUNIT@
260LAPACK_LIBS = @LAPACK_LIBS@ 262LAPACK_LIBS = @LAPACK_LIBS@
261LD = @LD@ 263LD = @LD@
262LDFLAGS = @LDFLAGS@ 264LDFLAGS = @LDFLAGS@
@@ -313,6 +315,7 @@ PVM_ENABLE = @PVM_ENABLE@
313PVM_INCLUDE = @PVM_INCLUDE@ 315PVM_INCLUDE = @PVM_INCLUDE@
314PVM_LIB = @PVM_LIB@ 316PVM_LIB = @PVM_LIB@
315PYTHON = @PYTHON@ 317PYTHON = @PYTHON@
318QDOX = @QDOX@
316RANLIB = @RANLIB@ 319RANLIB = @RANLIB@
317RELOCATABLE = @RELOCATABLE@ 320RELOCATABLE = @RELOCATABLE@
318RT_LIB = @RT_LIB@ 321RT_LIB = @RT_LIB@
@@ -331,6 +334,7 @@ SWIG_JAVA = @SWIG_JAVA@
331SWIG_RUNTIME_LIBS_DIR = @SWIG_RUNTIME_LIBS_DIR@ 334SWIG_RUNTIME_LIBS_DIR = @SWIG_RUNTIME_LIBS_DIR@
332TCLTK_LIBS = @TCLTK_LIBS@ 335TCLTK_LIBS = @TCLTK_LIBS@
333TCL_INC_PATH = @TCL_INC_PATH@ 336TCL_INC_PATH = @TCL_INC_PATH@
337TESTNG = @TESTNG@
334TK_INC_PATH = @TK_INC_PATH@ 338TK_INC_PATH = @TK_INC_PATH@
335UMFPACK_ENABLE = @UMFPACK_ENABLE@ 339UMFPACK_ENABLE = @UMFPACK_ENABLE@
336UMFPACK_LIB = @UMFPACK_LIB@ 340UMFPACK_LIB = @UMFPACK_LIB@
diff --git a/scilab/modules/io/sci_gateway/c/sci_file.c b/scilab/modules/io/sci_gateway/c/sci_file.c
index 99c8853..0c3b27a 100644
--- a/scilab/modules/io/sci_gateway/c/sci_file.c
+++ b/scilab/modules/io/sci_gateway/c/sci_file.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab 2 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3 * Copyright (C) 2006 - INRIA - Allan CORNET 3 * Copyright (C) 2006 - INRIA - Allan CORNET
4 * Copyright (C) 2009 - DIGITEO - Allan CORNET 4 * Copyright (C) 2009-2010 - DIGITEO - Allan CORNET
5 * 5 *
6 * This file must be used under the terms of the CeCILL. 6 * This file must be used under the terms of the CeCILL.
7 * This source file is licensed as described in the file COPYING, which 7 * This source file is licensed as described in the file COPYING, which
@@ -12,6 +12,7 @@
12 */ 12 */
13 13
14/*--------------------------------------------------------------------------*/ 14/*--------------------------------------------------------------------------*/
15#include <string.h>
15#include "gw_io.h" 16#include "gw_io.h"
16#include "stack-c.h" 17#include "stack-c.h"
17#include "api_scilab.h" 18#include "api_scilab.h"
@@ -20,12 +21,30 @@
20#include "Scierror.h" 21#include "Scierror.h"
21#include "localization.h" 22#include "localization.h"
22#include "charEncoding.h" 23#include "charEncoding.h"
24#include "filesmanagement.h"
25#include "freeArrayOfString.h"
26#ifdef _MSC_VER
27#include "strdup_windows.h"
28#endif
23/*--------------------------------------------------------------------------*/ 29/*--------------------------------------------------------------------------*/
24#define FILE_OPEN_STR "open" 30#define FILE_OPEN_STR "open"
25#define FILE_OLD_STR "old" 31#define FILE_OLD_STR "old"
26/*--------------------------------------------------------------------------*/ 32/*--------------------------------------------------------------------------*/
33static int sci_file_no_rhs(char *fname);
34static int sci_file_one_rhs(char *fname);
35/*--------------------------------------------------------------------------*/
27int C2F(sci_file)(char *fname,unsigned long fname_len) 36int C2F(sci_file)(char *fname,unsigned long fname_len)
28{ 37{
38 if (Rhs == 0)
39 {
40 return sci_file_no_rhs(fname);
41 }
42
43 if (Rhs == 1)
44 {
45 return sci_file_one_rhs(fname);
46 }
47
29 if (Rhs >= 3) 48 if (Rhs >= 3)
30 { 49 {
31 SciErr sciErr; 50 SciErr sciErr;
@@ -270,3 +289,317 @@ int C2F(sci_file)(char *fname,unsigned long fname_len)
270 return 0; 289 return 0;
271} 290}
272/*--------------------------------------------------------------------------*/ 291/*--------------------------------------------------------------------------*/
292static int sci_file_no_rhs(char *fname)
293{
294 SciErr sciErr;
295 int m_out = 0, n_out = 0;
296
297 int sizeArray = 0;
298 int *IdUsed = NULL;
299
300 CheckLhs(0,5);
301
302 /* Lhs == 0 IDs*/
303 IdUsed = GetFilesIdUsed(&sizeArray);
304
305 if (IdUsed)
306 {
307 m_out = 1;
308 n_out = sizeArray;
309 sciErr = createMatrixOfInteger32(pvApiCtx, Rhs + 1, m_out, n_out, IdUsed);
310 FREE(IdUsed);
311 IdUsed = NULL;
312
313 if(sciErr.iErr)
314 {
315 printError(&sciErr, 0);
316 return 0;
317 }
318
319 LhsVar(1) = Rhs + 1;
320 }
321
322 if (Lhs > 1) /* Types */
323 {
324 char **TypeIdsAsString = GetTypesUsedAsString(&sizeArray);
325 if (TypeIdsAsString)
326 {
327 m_out = 1;
328 n_out = sizeArray;
329 sciErr = createMatrixOfString(pvApiCtx, Rhs + 2, m_out, n_out, TypeIdsAsString);
330 freeArrayOfString(TypeIdsAsString, sizeArray);
331
332 if(sciErr.iErr)
333 {
334 printError(&sciErr, 0);
335 return 0;
336 }
337
338 LhsVar(2) = Rhs + 2;
339 }
340 }
341
342 if (Lhs > 2) /* names */
343 {
344 char **Filenames = GetFilenamesUsed(&sizeArray);
345 if (Filenames)
346 {
347 m_out = 1;
348 n_out = sizeArray;
349 sciErr = createMatrixOfString(pvApiCtx, Rhs + 3, m_out, n_out, Filenames);
350 freeArrayOfString(Filenames, sizeArray);
351
352 if(sciErr.iErr)
353 {
354 printError(&sciErr, 0);
355 return 0;
356 }
357
358 LhsVar(3) = Rhs + 3;
359 }
360 }
361
362 if (Lhs > 3) /* mod */
363 {
364 int *Modes = GetModesUsed(&sizeArray);
365 if (Modes)
366 {
367 m_out = 1;
368 n_out = sizeArray;
369 sciErr = createMatrixOfInteger32(pvApiCtx, Rhs + 4, m_out, n_out, Modes);
370 FREE(Modes);
371 Modes = NULL;
372 if(sciErr.iErr)
373 {
374 printError(&sciErr, 0);
375 return 0;
376 }
377
378 LhsVar(4) = Rhs + 4;
379 }
380 }
381
382 if (Lhs > 4) /* swap */
383 {
384 int *SwapId = GetSwapsUsed(&sizeArray);
385 if (SwapId)
386 {
387 m_out = 1;
388 n_out = sizeArray;
389 sciErr = createMatrixOfInteger32(pvApiCtx, Rhs + 5, m_out, n_out, SwapId);
390 FREE(SwapId);
391 SwapId = NULL;
392
393 if(sciErr.iErr)
394 {
395 printError(&sciErr, 0);
396 return 0;
397 }
398
399 LhsVar(5) = Rhs + 5;
400 }
401 }
402
403 C2F(putlhsvar)();
404 return 0;
405}
406/*--------------------------------------------------------------------------*/
407static int sci_file_one_rhs(char *fname)
408{
409 SciErr sciErr;
410
411 int iID = 0;
412 int m1 = 0, n1 = 0;
413 int iType = 0;
414 int *piAddressVarOne = NULL;
415 double *pdVarOne = NULL;
416
417 int m_out = 0;
418 int n_out = 0;
419
420 /* get Address of inputs */
421 sciErr = getVarAddressFromPosition(pvApiCtx, 1, &piAddressVarOne);
422 if(sciErr.iErr)
423 {
424 printError(&sciErr, 0);
425 return 0;
426 }
427
428 sciErr = getVarType(pvApiCtx, piAddressVarOne, &iType);
429 if(sciErr.iErr)
430 {
431 printError(&sciErr, 0);
432 return 0;
433 }
434
435 /* check input type */
436 if ( iType != sci_matrix )
437 {
438 Scierror(201,_("%s: Wrong type for input argument #%d: A scalar expected.\n"),fname,1);
439 return 0;
440 }
441
442 sciErr = getMatrixOfDouble(pvApiCtx, piAddressVarOne,&m1,&n1,&pdVarOne);
443 if(sciErr.iErr)
444 {
445 printError(&sciErr, 0);
446 return 0;
447 }
448
449 if( n1 != 1 || m1 != 1)
450 {
451 Scierror(999,_("%s: Wrong size for input argument #%d: A scalar expected.\n"),fname,1);
452 return 0;
453 }
454
455 iID = (int) *pdVarOne;
456
457 if (*pdVarOne != (double)iID)
458 {
459 Scierror(999,_("%s: Wrong value for input argument #%d: A integer expected.\n"),fname,1);
460 return 0;
461 }
462
463 /* Lhs = 0 ID */
464 if (GetFileTypeOpenedInScilab(iID) != 0)
465 {
466 m_out = 1;
467 n_out = 1;
468 sciErr = createMatrixOfInteger32(pvApiCtx, Rhs + 1, m_out, n_out, &iID);
469 }
470 else
471 {
472 /* returns [] */
473 m_out = 0;
474 n_out = 0;
475 sciErr = createMatrixOfDouble(pvApiCtx, Rhs + 1, m_out, n_out, NULL);
476 }
477
478 if(sciErr.iErr)
479 {
480 printError(&sciErr, 0);
481 return 0;
482 }
483
484 LhsVar(1) = Rhs + 1;
485
486 if (Lhs > 1) /* Type */
487 {
488 if (GetFileTypeOpenedInScilab(iID) != 0)
489 {
490 char *TypeIdAsString = GetFileTypeOpenedInScilabAsString(iID);
491 m_out = 1;
492 n_out = 1;
493 sciErr = createMatrixOfString(pvApiCtx, Rhs + 2, m_out, n_out, &TypeIdAsString);
494 FREE(TypeIdAsString);
495 TypeIdAsString = NULL;
496 }
497 else
498 {
499 /* returns [] */
500 m_out = 0;
501 n_out = 0;
502 sciErr = createMatrixOfDouble(pvApiCtx, Rhs + 2, m_out, n_out, NULL);
503 }
504
505 if(sciErr.iErr)
506 {
507 printError(&sciErr, 0);
508 return 0;
509 }
510
511 LhsVar(2) = Rhs + 2;
512 }
513
514 if (Lhs > 2) /* name */
515 {
516 if (GetFileTypeOpenedInScilab(iID) != 0)
517 {
518 char *filename = NULL;
519 m_out = 1;
520 n_out = 1;
521 if (GetFileNameOpenedInScilab(iID) == NULL)
522 {
523 filename = strdup("");
524 }
525 else
526 {
527 filename = strdup(GetFileNameOpenedInScilab(iID));
528 }
529
530 sciErr = createMatrixOfString(pvApiCtx, Rhs + 3, m_out, n_out, &filename);
531 FREE(filename);
532 filename = NULL;
533 }
534 else
535 {
536 /* returns [] */
537 m_out = 0;
538 n_out = 0;
539 sciErr = createMatrixOfDouble(pvApiCtx, Rhs + 3, m_out, n_out, NULL);
540 }
541
542 if(sciErr.iErr)
543 {
544 printError(&sciErr, 0);
545 return 0;
546 }
547
548 LhsVar(3) = Rhs + 3;
549 }
550
551 if (Lhs > 3) /* mod */
552 {
553 if (GetFileTypeOpenedInScilab(iID) != 0)
554 {
555 int ModeId = GetFileModeOpenedInScilab(iID);
556 m_out = 1;
557 n_out = 1;
558 sciErr = createMatrixOfInteger32(pvApiCtx, Rhs + 4, m_out, n_out, &ModeId);
559 }
560 else
561 {
562 /* returns [] */
563 m_out = 0;
564 n_out = 0;
565 sciErr = createMatrixOfDouble(pvApiCtx, Rhs + 4, m_out, n_out, NULL);
566 }
567
568 if(sciErr.iErr)
569 {
570 printError(&sciErr, 0);
571 return 0;
572 }
573
574 LhsVar(4) = Rhs + 4;
575 }
576
577 if (Lhs > 4) /* swap */
578 {
579 if (GetFileTypeOpenedInScilab(iID) != 0)
580 {
581 int SwapId = GetSwapStatus(iID);
582 m_out = 1;
583 n_out = 1;
584 sciErr = createMatrixOfInteger32(pvApiCtx, Rhs + 5, m_out, n_out, &SwapId);
585 }
586 else
587 {
588 /* returns [] */
589 m_out = 0;
590 n_out = 0;
591 sciErr = createMatrixOfDouble(pvApiCtx, Rhs + 5, m_out, n_out, NULL);
592 }
593
594 if(sciErr.iErr)
595 {
596 printError(&sciErr, 0);
597 return 0;
598 }
599 LhsVar(5) = Rhs + 5;
600 }
601
602 C2F(putlhsvar)();
603 return 0;
604}
605/*--------------------------------------------------------------------------*/
diff --git a/scilab/modules/io/src/c/io.vcproj b/scilab/modules/io/src/c/io.vcproj
index 00f3754..ff06774 100644
--- a/scilab/modules/io/src/c/io.vcproj
+++ b/scilab/modules/io/src/c/io.vcproj
@@ -43,7 +43,7 @@
43 /> 43 />
44 <Tool 44 <Tool
45 Name="VCCLCompilerTool" 45 Name="VCCLCompilerTool"
46 AdditionalOptions="/arch:IA32" 46 AdditionalOptions=""
47 Optimization="0" 47 Optimization="0"
48 AdditionalIncludeDirectories=".;../../includes;../../../../libs/MALLOC/includes;../../../localization/includes;../../../api_scilab/includes;../../../core/includes;../../../output_stream/includes;../../../../libs/hashtable;../../../fileio/includes;../../../windows_tools/includes;../../../../libs/intl" 48 AdditionalIncludeDirectories=".;../../includes;../../../../libs/MALLOC/includes;../../../localization/includes;../../../api_scilab/includes;../../../core/includes;../../../output_stream/includes;../../../../libs/hashtable;../../../fileio/includes;../../../windows_tools/includes;../../../../libs/intl"
49 PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;FORDLL;_DEBUG;_WINDOWS;_USRDLL;IO_EXPORTS" 49 PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;FORDLL;_DEBUG;_WINDOWS;_USRDLL;IO_EXPORTS"
@@ -210,7 +210,7 @@
210 /> 210 />
211 <Tool 211 <Tool
212 Name="VCCLCompilerTool" 212 Name="VCCLCompilerTool"
213 AdditionalOptions="/arch:IA32" 213 AdditionalOptions=""
214 InlineFunctionExpansion="1" 214 InlineFunctionExpansion="1"
215 FavorSizeOrSpeed="1" 215 FavorSizeOrSpeed="1"
216 WholeProgramOptimization="false" 216 WholeProgramOptimization="false"
diff --git a/scilab/modules/io/src/fortran/io_f.vfproj b/scilab/modules/io/src/fortran/io_f.vfproj
index e15e192..a6d78d1 100644
--- a/scilab/modules/io/src/fortran/io_f.vfproj
+++ b/scilab/modules/io/src/fortran/io_f.vfproj
@@ -5,7 +5,7 @@
5 <Platform Name="x64"/></Platforms> 5 <Platform Name="x64"/></Platforms>
6 <Configurations> 6 <Configurations>
7 <Configuration Name="Debug|Win32" OutputDirectory="$(InputDir)$(ConfigurationName)" DeleteExtensionsOnClean="*.obj;*.mod;*.pdb;*.asm;*.map;*.dyn;*.dpi;*.tmp;*.log;*.ilk;*.dll;$(TargetPath)" ConfigurationType="typeDynamicLibrary"> 7 <Configuration Name="Debug|Win32" OutputDirectory="$(InputDir)$(ConfigurationName)" DeleteExtensionsOnClean="*.obj;*.mod;*.pdb;*.asm;*.map;*.dyn;*.dpi;*.tmp;*.log;*.ilk;*.dll;$(TargetPath)" ConfigurationType="typeDynamicLibrary">
8 <Tool Name="VFFortranCompilerTool" AdditionalOptions="/arch:IA32" SuppressStartupBanner="true" DebugInformationFormat="debugEnabled" Optimization="optimizeDisabled" AdditionalIncludeDirectories="../../../core/includes" PreprocessorDefinitions="WIN32;FORDLL" AlternateParameterSyntax="false" F77RuntimeCompatibility="true" FPS4Libs="false" CallingConvention="callConventionCRef" ExternalNameUnderscore="true" ModulePath="$(INTDIR)/" ObjectFile="$(INTDIR)/" RuntimeLibrary="rtMultiThreadedDebugDLL"/> 8 <Tool Name="VFFortranCompilerTool" AdditionalOptions="" SuppressStartupBanner="true" DebugInformationFormat="debugEnabled" Optimization="optimizeDisabled" AdditionalIncludeDirectories="../../../core/includes" PreprocessorDefinitions="WIN32;FORDLL" AlternateParameterSyntax="false" F77RuntimeCompatibility="true" FPS4Libs="false" CallingConvention="callConventionCRef" ExternalNameUnderscore="true" ModulePath="$(INTDIR)/" ObjectFile="$(INTDIR)/" RuntimeLibrary="rtMultiThreadedDebugDLL"/>
9 <Tool Name="VFLinkerTool" OutputFile="$(SolutionDir)bin\io_f.dll" LinkIncremental="linkIncrementalNo" SuppressStartupBanner="true" ModuleDefinitionFile="io_f.def" GenerateDebugInformation="true" SubSystem="subSystemWindows" ImportLibrary="$(SolutionDir)bin\io_f.lib" LinkDLL="true" AdditionalDependencies="Libscilab.lib output_stream_f.lib"/> 9 <Tool Name="VFLinkerTool" OutputFile="$(SolutionDir)bin\io_f.dll" LinkIncremental="linkIncrementalNo" SuppressStartupBanner="true" ModuleDefinitionFile="io_f.def" GenerateDebugInformation="true" SubSystem="subSystemWindows" ImportLibrary="$(SolutionDir)bin\io_f.lib" LinkDLL="true" AdditionalDependencies="Libscilab.lib output_stream_f.lib"/>
10 <Tool Name="VFResourceCompilerTool"/> 10 <Tool Name="VFResourceCompilerTool"/>
11 <Tool Name="VFMidlTool" SuppressStartupBanner="true" HeaderFileName="$(InputName).h" TypeLibraryName="$(IntDir)/$(InputName).tlb"/> 11 <Tool Name="VFMidlTool" SuppressStartupBanner="true" HeaderFileName="$(InputName).h" TypeLibraryName="$(IntDir)/$(InputName).tlb"/>
@@ -23,7 +23,7 @@ lib /DEF:&quot;$(InputDir)output_stream_f_Import.def&quot; /SUBSYSTEM:WINDOWS /M
23 <Tool Name="VFPostBuildEventTool"/> 23 <Tool Name="VFPostBuildEventTool"/>
24 <Tool Name="VFManifestTool" SuppressStartupBanner="true"/></Configuration> 24 <Tool Name="VFManifestTool" SuppressStartupBanner="true"/></Configuration>
25 <Configuration Name="Release|Win32" OutputDirectory="$(InputDir)$(ConfigurationName)" DeleteExtensionsOnClean="*.obj;*.mod;*.pdb;*.asm;*.map;*.dyn;*.dpi;*.tmp;*.log;*.ilk;*.dll;$(TargetPath)" ConfigurationType="typeDynamicLibrary"> 25 <Configuration Name="Release|Win32" OutputDirectory="$(InputDir)$(ConfigurationName)" DeleteExtensionsOnClean="*.obj;*.mod;*.pdb;*.asm;*.map;*.dyn;*.dpi;*.tmp;*.log;*.ilk;*.dll;$(TargetPath)" ConfigurationType="typeDynamicLibrary">
26 <Tool Name="VFFortranCompilerTool" AdditionalOptions="/arch:IA32" SuppressStartupBanner="true" AdditionalIncludeDirectories="../../../core/includes" PreprocessorDefinitions="WIN32;FORDLL" AlternateParameterSyntax="false" F77RuntimeCompatibility="true" FPS4Libs="false" CallingConvention="callConventionCRef" ExternalNameUnderscore="true" ModulePath="$(INTDIR)/" ObjectFile="$(INTDIR)/" RuntimeLibrary="rtMultiThreadedDLL"/> 26 <Tool Name="VFFortranCompilerTool" AdditionalOptions="" SuppressStartupBanner="true" AdditionalIncludeDirectories="../../../core/includes" PreprocessorDefinitions="WIN32;FORDLL" AlternateParameterSyntax="false" F77RuntimeCompatibility="true" FPS4Libs="false" CallingConvention="callConventionCRef" ExternalNameUnderscore="true" ModulePath="$(INTDIR)/" ObjectFile="$(INTDIR)/" RuntimeLibrary="rtMultiThreadedDLL"/>
27 <Tool Name="VFLinkerTool" OutputFile="$(SolutionDir)bin\io_f.dll" LinkIncremental="linkIncrementalNo" SuppressStartupBanner="true" ModuleDefinitionFile="io_f.def" SubSystem="subSystemWindows" ImportLibrary="$(SolutionDir)bin\io_f.lib" LinkDLL="true" AdditionalDependencies="Libscilab.lib output_stream_f.lib"/> 27 <Tool Name="VFLinkerTool" OutputFile="$(SolutionDir)bin\io_f.dll" LinkIncremental="linkIncrementalNo" SuppressStartupBanner="true" ModuleDefinitionFile="io_f.def" SubSystem="subSystemWindows" ImportLibrary="$(SolutionDir)bin\io_f.lib" LinkDLL="true" AdditionalDependencies="Libscilab.lib output_stream_f.lib"/>
28 <Tool Name="VFResourceCompilerTool"/> 28 <Tool Name="VFResourceCompilerTool"/>
29 <Tool Name="VFMidlTool" SuppressStartupBanner="true" HeaderFileName="$(InputName).h" TypeLibraryName="$(IntDir)/$(InputName).tlb"/> 29 <Tool Name="VFMidlTool" SuppressStartupBanner="true" HeaderFileName="$(InputName).h" TypeLibraryName="$(IntDir)/$(InputName).tlb"/>
diff --git a/scilab/modules/io/tests/unit_tests/file.dia.ref b/scilab/modules/io/tests/unit_tests/file.dia.ref
new file mode 100644
index 0000000..d6ba3e6
--- /dev/null
+++ b/scilab/modules/io/tests/unit_tests/file.dia.ref
@@ -0,0 +1,47 @@
1// =============================================================================
2// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3// Copyright (C) 2010 - DIGITEO - Allan CORNET
4//
5// This file is distributed under the same license as the Scilab package.
6// =============================================================================
7// =============================================================================
8// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
9// Copyright (C) 2010 - DIGITEO - Allan CORNET
10//
11// This file is distributed under the same license as the Scilab package.
12// =============================================================================
13[a,b,c,d,e] = file(500);
14if a <> [] then bugmes();quit;end;
15if b <> [] then bugmes();quit;end;
16if c <> [] then bugmes();quit;end;
17if d <> [] then bugmes();quit;end;
18if e <> [] then bugmes();quit;end;
19clear a b c d e
20// =============================================================================
21[a,b,c,d] = file(500);
22if a <> [] then bugmes();quit;end;
23if b <> [] then bugmes();quit;end;
24if c <> [] then bugmes();quit;end;
25if d <> [] then bugmes();quit;end;
26clear a b c d
27// =============================================================================
28[a,b,c] = file(500);
29if a <> [] then bugmes();quit;end;
30if b <> [] then bugmes();quit;end;
31if c <> [] then bugmes();quit;end;
32clear a b c
33// =============================================================================
34[a,b] = file(500);
35if a <> [] then bugmes();quit;end;
36if b <> [] then bugmes();quit;end;
37clear a b
38// =============================================================================
39[a] = file(500);
40if a <> [] then bugmes();quit;end;
41clear a
42// =============================================================================
43file(500);
44// =============================================================================
45ierr = execstr("file(''toto'')","errcatch");
46if (ierr <> 201) then bugmes();quit;end
47// =============================================================================
diff --git a/scilab/modules/io/tests/unit_tests/file.tst b/scilab/modules/io/tests/unit_tests/file.tst
new file mode 100644
index 0000000..2c367c0
--- /dev/null
+++ b/scilab/modules/io/tests/unit_tests/file.tst
@@ -0,0 +1,48 @@
1// =============================================================================
2// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3// Copyright (C) 2010 - DIGITEO - Allan CORNET
4//
5// This file is distributed under the same license as the Scilab package.
6// =============================================================================
7// =============================================================================
8// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
9// Copyright (C) 2010 - DIGITEO - Allan CORNET
10//
11// This file is distributed under the same license as the Scilab package.
12// =============================================================================
13[a,b,c,d,e] = file(500);
14if a <> [] then pause,end;
15if b <> [] then pause,end;
16if c <> [] then pause,end;
17if d <> [] then pause,end;
18if e <> [] then pause,end;
19clear a b c d e
20// =============================================================================
21[a,b,c,d] = file(500);
22if a <> [] then pause,end;
23if b <> [] then pause,end;
24if c <> [] then pause,end;
25if d <> [] then pause,end;
26clear a b c d
27// =============================================================================
28[a,b,c] = file(500);
29if a <> [] then pause,end;
30if b <> [] then pause,end;
31if c <> [] then pause,end;
32clear a b c
33// =============================================================================
34[a,b] = file(500);
35if a <> [] then pause,end;
36if b <> [] then pause,end;
37clear a b
38// =============================================================================
39[a] = file(500);
40if a <> [] then pause,end;
41clear a
42// =============================================================================
43file(500);
44// =============================================================================
45ierr = execstr("file(''toto'')","errcatch");
46if (ierr <> 201) then pause,end
47// =============================================================================
48