bug 4461
Allan CORNET [Mon, 27 Apr 2009 08:34:00 +0000 (10:34 +0200)]
20 files changed:
scilab/CHANGES_5.2.X
scilab/modules/core/Makefile.am
scilab/modules/core/src/c/core.vcproj
scilab/modules/core/src/c/tmpdir.c
scilab/modules/core/src/fortran/core_f.vfproj
scilab/modules/core/src/fortran/core_f2c.vcproj
scilab/modules/fileio/tests/nonreg_tests/bug_4461.tst [new file with mode: 0644]
scilab/modules/shell/Makefile.am
scilab/modules/shell/help/en_US/prompt.xml
scilab/modules/shell/includes/prompt.h [moved from scilab/modules/core/includes/prompt.h with 97% similarity]
scilab/modules/shell/includes/promptecho.h [new file with mode: 0644]
scilab/modules/shell/sci_gateway/c/sci_prompt.c
scilab/modules/shell/src/c/GetCommandLine.c
scilab/modules/shell/src/c/LibScilab_Import.def
scilab/modules/shell/src/c/fileio_Import.def [new file with mode: 0644]
scilab/modules/shell/src/c/others/zzledt.c
scilab/modules/shell/src/c/prompt.c [moved from scilab/modules/core/src/c/prompt.c with 92% similarity]
scilab/modules/shell/src/c/promptecho.c [new file with mode: 0644]
scilab/modules/shell/src/c/shell.vcproj
scilab/modules/shell/src/c/windows/TermReadAndProcess.c

index 0fcf241..41cd064 100644 (file)
@@ -130,3 +130,5 @@ Bug fixes:
 
 * bug 4433 fixed - problem using optim. On some examples, the optim function makes scilab hangs.
 
+* bug 4461 fixed - redefines prompt not displayed in a diary.
+
index 5e01a53..a7ec1f0 100644 (file)
@@ -30,7 +30,6 @@ src/c/setgetSCIpath.c \
 src/c/getmemory.c \
 src/c/Funtab.c \
 src/c/csignal.c \
-src/c/prompt.c \
 src/c/callinterf.c \
 src/c/scimem.c \
 src/c/banier.c \
@@ -194,8 +193,7 @@ src/fortran/wmdsp.f \
 src/fortran/stackr2d.f \
 src/fortran/stacki2d.f \
 src/fortran/stackc2i.f \
-src/fortran/isinstring.f \
-src/fortran/promptecho.f
+src/fortran/isinstring.f 
 
 if USE_DYNAMIC_STACK
 CORE_FORTRAN_SOURCES += src/fortran/relocstack.f
@@ -388,7 +386,6 @@ includes/machine.h.vc \
 includes/Os_specific.h \
 includes/PARAMS.h \
 includes/PATH_MAX.h \
-includes/prompt.h \
 includes/realmain.h \
 includes/returnanan.h \
 includes/returnProperty.h \
index 21851e6..93b0fdb 100644 (file)
@@ -45,7 +45,7 @@
                        <Tool
                                Name="VCCLCompilerTool"
                                Optimization="0"
-                               AdditionalIncludeDirectories=".;../../includes;../../../../libs/dynamiclibrary/includes;../../../../libs/doublylinkedlist/includes;../../../../libs/MALLOC/includes;../../../mexlib/includes;../../../gui/src/c/wsci;../../../string/includes;../../../dynamic_link/includes;../../../../libs/libxml2;../../../../libs/libxml2/libxml;../../../action_binding/includes;../../../output_stream/includes;../../../fileio/includes;../../../elementary_functions/includes;../../../tclsci/includes;../../../localization/includes;../../../pvm/includes;../../../../libs/intl;../../../tclsci/includes/tcltk;../../../windows_tools/includes;../../../windows_tools/src/c/scilab_windows;../../../intersci/includes;../../../call_scilab/includes;../../../call_scilab/src/c;../../../graphics/includes"
+                               AdditionalIncludeDirectories=".;../../includes;../../../../libs/dynamiclibrary/includes;../../../../libs/doublylinkedlist/includes;../../../../libs/MALLOC/includes;../../../mexlib/includes;../../../gui/src/c/wsci;../../../string/includes;../../../dynamic_link/includes;../../../../libs/libxml2;../../../../libs/libxml2/libxml;../../../action_binding/includes;../../../output_stream/includes;../../../fileio/includes;../../../elementary_functions/includes;../../../tclsci/includes;../../../localization/includes;../../../pvm/includes;../../../shell/includes;../../../../libs/intl;../../../tclsci/includes/tcltk;../../../windows_tools/includes;../../../windows_tools/src/c/scilab_windows;../../../intersci/includes;../../../call_scilab/includes;../../../call_scilab/src/c;../../../graphics/includes"
                                PreprocessorDefinitions="_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;WITH_TK;WITH_ATLAS;__STDC__"
                                BasicRuntimeChecks="0"
                                RuntimeLibrary="3"
                        <Tool
                                Name="VCCLCompilerTool"
                                Optimization="0"
-                               AdditionalIncludeDirectories=".;../../includes;../../../../libs/dynamiclibrary/includes;../../../../libs/doublylinkedlist/includes;../../../../libs/MALLOC/includes;../../../mexlib/includes;../../../gui/src/c/wsci;../../../string/includes;../../../dynamic_link/includes;../../../../libs/libxml2;../../../../libs/libxml2/libxml;../../../action_binding/includes;../../../output_stream/includes;../../../fileio/includes;../../../elementary_functions/includes;../../../tclsci/includes;../../../localization/includes;../../../pvm/includes;../../../../libs/intl;../../../tclsci/includes/tcltk;../../../windows_tools/includes;../../../windows_tools/src/c/scilab_windows;../../../intersci/includes;../../../call_scilab/includes;../../../call_scilab/src/c;../../../graphics/includes"
+                               AdditionalIncludeDirectories=".;../../includes;../../../../libs/dynamiclibrary/includes;../../../../libs/doublylinkedlist/includes;../../../../libs/MALLOC/includes;../../../mexlib/includes;../../../gui/src/c/wsci;../../../string/includes;../../../dynamic_link/includes;../../../../libs/libxml2;../../../../libs/libxml2/libxml;../../../action_binding/includes;../../../output_stream/includes;../../../fileio/includes;../../../elementary_functions/includes;../../../tclsci/includes;../../../localization/includes;../../../pvm/includes;../../../shell/includes;../../../../libs/intl;../../../tclsci/includes/tcltk;../../../windows_tools/includes;../../../windows_tools/src/c/scilab_windows;../../../intersci/includes;../../../call_scilab/includes;../../../call_scilab/src/c;../../../graphics/includes"
                                PreprocessorDefinitions="_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;WITH_TK;WITH_ATLAS;__STDC__"
                                BasicRuntimeChecks="0"
                                RuntimeLibrary="3"
                                Optimization="2"
                                InlineFunctionExpansion="1"
                                FavorSizeOrSpeed="1"
-                               AdditionalIncludeDirectories=".;../../includes;../../../../libs/dynamiclibrary/includes;../../../../libs/doublylinkedlist/includes;../../../../libs/MALLOC/includes;../../../mexlib/includes;../../../gui/src/c/wsci;../../../string/includes;../../../dynamic_link/includes;../../../../libs/libxml2;../../../../libs/libxml2/libxml;../../../action_binding/includes;../../../output_stream/includes;../../../fileio/includes;../../../elementary_functions/includes;../../../tclsci/includes;../../../localization/includes;../../../pvm/includes;../../../../libs/intl;../../../tclsci/includes/tcltk;../../../windows_tools/includes;../../../windows_tools/src/c/scilab_windows;../../../intersci/includes;../../../call_scilab/includes;../../../call_scilab/src/c;../../../graphics/includes"
+                               AdditionalIncludeDirectories=".;../../includes;../../../../libs/dynamiclibrary/includes;../../../../libs/doublylinkedlist/includes;../../../../libs/MALLOC/includes;../../../mexlib/includes;../../../gui/src/c/wsci;../../../string/includes;../../../dynamic_link/includes;../../../../libs/libxml2;../../../../libs/libxml2/libxml;../../../action_binding/includes;../../../output_stream/includes;../../../fileio/includes;../../../elementary_functions/includes;../../../tclsci/includes;../../../localization/includes;../../../pvm/includes;../../../shell/includes;../../../../libs/intl;../../../tclsci/includes/tcltk;../../../windows_tools/includes;../../../windows_tools/src/c/scilab_windows;../../../intersci/includes;../../../call_scilab/includes;../../../call_scilab/src/c;../../../graphics/includes"
                                PreprocessorDefinitions="NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;WITH_TK;WITH_ATLAS;__STDC__"
                                StringPooling="true"
                                RuntimeLibrary="2"
                                Optimization="2"
                                InlineFunctionExpansion="1"
                                FavorSizeOrSpeed="1"
-                               AdditionalIncludeDirectories=".;../../includes;../../../../libs/dynamiclibrary/includes;../../../../libs/doublylinkedlist/includes;../../../../libs/MALLOC/includes;../../../mexlib/includes;../../../gui/src/c/wsci;../../../string/includes;../../../dynamic_link/includes;../../../../libs/libxml2;../../../../libs/libxml2/libxml;../../../action_binding/includes;../../../output_stream/includes;../../../fileio/includes;../../../elementary_functions/includes;../../../tclsci/includes;../../../localization/includes;../../../pvm/includes;../../../../libs/intl;../../../tclsci/includes/tcltk;../../../windows_tools/includes;../../../windows_tools/src/c/scilab_windows;../../../intersci/includes;../../../call_scilab/includes;../../../call_scilab/src/c;../../../graphics/includes"
+                               AdditionalIncludeDirectories=".;../../includes;../../../../libs/dynamiclibrary/includes;../../../../libs/doublylinkedlist/includes;../../../../libs/MALLOC/includes;../../../mexlib/includes;../../../gui/src/c/wsci;../../../string/includes;../../../dynamic_link/includes;../../../../libs/libxml2;../../../../libs/libxml2/libxml;../../../action_binding/includes;../../../output_stream/includes;../../../fileio/includes;../../../elementary_functions/includes;../../../tclsci/includes;../../../localization/includes;../../../pvm/includes;../../../shell/includes;../../../../libs/intl;../../../tclsci/includes/tcltk;../../../windows_tools/includes;../../../windows_tools/src/c/scilab_windows;../../../intersci/includes;../../../call_scilab/includes;../../../call_scilab/src/c;../../../graphics/includes"
                                PreprocessorDefinitions="NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;WITH_TK;WITH_ATLAS;__STDC__"
                                StringPooling="true"
                                RuntimeLibrary="2"
                                >
                        </File>
                        <File
-                               RelativePath=".\prompt.c"
-                               >
-                       </File>
-                       <File
                                RelativePath=".\readGateway.c"
                                >
                        </File>
                                >
                        </File>
                        <File
-                               RelativePath="..\..\includes\fromjava.h"
+                               RelativePath=".\fromjava.h"
                                >
                        </File>
                        <File
-                               RelativePath=".\fromjava.h"
+                               RelativePath="..\..\includes\fromjava.h"
                                >
                        </File>
                        <File
                                >
                        </File>
                        <File
-                               RelativePath="..\..\includes\prompt.h"
-                               >
-                       </File>
-                       <File
                                RelativePath=".\readGateway.h"
                                >
                        </File>
index cf431ec..f081c15 100644 (file)
@@ -33,7 +33,6 @@ extern  char  *getenv();
 #include "strdup_windows.h"
 #endif
 #include "MALLOC.h" /* MALLOC */
-#include "prompt.h"
 #include "tmpdir.h"
 #include "localization.h"
 #include "charEncoding.h"
index fe6e5a8..9809c66 100644 (file)
@@ -149,7 +149,6 @@ cd .."/></Configuration></Configurations>
                <File RelativePath="print.f"/>
                <File RelativePath="prntid.f"/>
                <File RelativePath="prompt.f"/>
-               <File RelativePath=".\promptecho.f"/>
                <File RelativePath="ptover.f"/>
                <File RelativePath="ptrback.f"/>
                <File RelativePath="putid.f"/>
index 908cdff..ee48af8 100644 (file)
                                >
                        </File>
                        <File
-                               RelativePath=".\promptecho.c"
-                               >
-                       </File>
-                       <File
                                RelativePath=".\ptover.c"
                                >
                        </File>
                                >
                        </File>
                        <File
-                               RelativePath=".\promptecho.f"
-                               >
-                       </File>
-                       <File
                                RelativePath=".\ptover.f"
                                >
                        </File>
diff --git a/scilab/modules/fileio/tests/nonreg_tests/bug_4461.tst b/scilab/modules/fileio/tests/nonreg_tests/bug_4461.tst
new file mode 100644 (file)
index 0000000..0012472
--- /dev/null
@@ -0,0 +1,34 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) DIGITEO - 2009 - Allan CORNET
+//
+//  This file is distributed under the same license as the Scilab package.
+// =============================================================================
+
+// <-- JVM NOT MANDATORY -->
+
+// <-- Non-regression test for bug 4461 -->
+//
+// <-- Bugzilla URL -->
+// http://bugzilla.scilab.org/show_bug.cgi?id=4461
+//
+// <-- Short Description -->
+// prompt('TEST Prompt->') not managed by a diary
+
+
+// <-- INTERACTIVE TEST -->
+
+// with current diary we can not do many diaries
+
+diary(TMPDIR+'/testdiary.txt')
+prompt('- TEST Prompt ->')
+1+1
+disp(1:10)
+diary(0)
+
+
+// opens TMPDIR+'/testdiary.txt' with a text editor and checks that
+// -->prompt('TEST Prompt->')
+// TEST Prompt->1+1
+
+
index 30239ec..791719b 100644 (file)
@@ -15,7 +15,10 @@ src/c/others/zzledt.c \
 src/c/others/gotoxy_nw.c \
 src/c/others/clrscr_nw.c \
 src/c/InitializeShell.c \
-src/c/TerminateShell.c 
+src/c/TerminateShell.c \
+src/c/prompt.c \
+src/c/promptecho.c
+
 
 if IS_MACOSX
 SHELL_C_SOURCES += src/c/others/initMacOSXEnv.c
@@ -37,7 +40,6 @@ libscishell_la_CPPFLAGS =  $(JAVA_JNI_INCLUDE) -I$(srcdir)/includes/ -I$(srcdir)
 libscishell_la_CFLAGS=         $(JAVA_JNI_INCLUDE) \
                        -Iincludes/ \
                        -Isrc/c/ \
-                       -Isrc/c/others/ \
                        -I$(top_srcdir)/libs/MALLOC/includes/ \
                        -I$(top_srcdir)/modules/console/includes/ \
                        -I$(top_srcdir)/modules/history_manager/includes/ \
@@ -46,7 +48,8 @@ libscishell_la_CFLAGS=        $(JAVA_JNI_INCLUDE) \
                        -I$(top_srcdir)/modules/completion/includes \
                        -I$(top_srcdir)/modules/localization/includes \
                        -I$(top_srcdir)/modules/action_binding/includes/ \
-                       -I$(top_srcdir)/modules/fileio/src/c/
+                       -I$(top_srcdir)/modules/fileio/src/c/ \
+                       -I$(top_srcdir)/modules/fileio/includes/
 
 # Name of the future library (.la will be replace by .so, .a, etc regarding
 # the system)
@@ -88,7 +91,10 @@ includes/TerminateShell.h \
 includes/more.h \
 includes/PutChar.h \
 includes/tohome.h \
-includes/zzledt.h
+includes/zzledt.h \
+includes/prompt.h \
+includes/promptecho.h
+
 
 if GUI
 
index 72392c6..81dd089 100644 (file)
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
+<?xml version="1.0" encoding="UTF-8"?>
 <!--
     * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
     * Copyright (C) 2007 - INRIA - Allan CORNET
     * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
     *
     -->
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" version="5.0-subset Scilab" xml:lang="en" xml:id="prompt">
+<refentry version="5.0-subset Scilab" xml:id="prompt" xml:lang="en"
+          xmlns="http://docbook.org/ns/docbook"
+          xmlns:xlink="http://www.w3.org/1999/xlink"
+          xmlns:svg="http://www.w3.org/2000/svg"
+          xmlns:ns4="http://www.w3.org/1999/xhtml"
+          xmlns:mml="http://www.w3.org/1998/Math/MathML"
+          xmlns:db="http://docbook.org/ns/docbook">
   <info>
-    <pubdate>$LastChangedDate: 2007-05-13 12:13:33 +0200 (dim., 13 mai 2007) $</pubdate>
+    <pubdate>$LastChangedDate: 2007-05-13 12:13:33 +0200 (dim., 13 mai 2007)
+    $</pubdate>
   </info>
+
   <refnamediv>
     <refname>prompt</refname>
+
     <refpurpose>Get/Set current prompt</refpurpose>
   </refnamediv>
+
   <refsynopsisdiv>
     <title>Calling Sequence</title>
+
     <synopsis>
       currentprompt = prompt()
+      [currentprompt,pauselevel] = prompt()
       prompt(userprompt)
     </synopsis>
   </refsynopsisdiv>
+
   <refsection>
     <title>Parameters</title>
+
     <variablelist>
       <varlistentry>
         <term>currentprompt</term>
+
         <listitem>
           <para>String: current prompt returned as a character string.</para>
         </listitem>
       </varlistentry>
+      
+      <varlistentry>
+        <term>pauselevel</term>
+
+        <listitem>
+          <para>integer: current pause level.</para>
+        </listitem>
+      </varlistentry>
+
       <varlistentry>
         <term>userprompt</term>
+
         <listitem>
-          <para>String: prompt to display for next user input. Then current prompt will be used again.</para>
+          <para>String: prompt to display for next user input. Then current
+          prompt will be used again.</para>
         </listitem>
       </varlistentry>
     </variablelist>
   </refsection>
+
   <refsection>
     <title>Description</title>
-    <para><literal>currentprompt = prompt()</literal> gets the current prompt.</para>
+
+    <para><literal>currentprompt = prompt()</literal> gets the current
+    prompt.</para>
+
     <para><literal>prompt(userprompt)</literal> sets the prompt.</para>
   </refsection>
+
   <refsection>
     <title>See Also</title>
+
     <simplelist type="inline">
-      <member>
-        <link linkend="pause">pause</link>
-      </member>
-      <member>
-        <link linkend="input">input</link>
-      </member>
+      <member><link linkend="pause">pause</link></member>
+
+      <member><link linkend="input">input</link></member>
     </simplelist>
   </refsection>
+
   <refsection>
     <title>Authors</title>
+
     <simplelist type="vert">
       <member>A.C.</member>
     </simplelist>
similarity index 97%
rename from scilab/modules/core/includes/prompt.h
rename to scilab/modules/shell/includes/prompt.h
index 9e68a44..d5b3afd 100644 (file)
@@ -31,6 +31,8 @@
 #endif
 #define SCIPROMPT_INTERRUPT "-%d->"
 
+#define PROMPT_SIZE_MAX 64
+
 /*--------------------------------------------------------------------------*/ 
 void C2F(setprlev)( int *pause);
 void GetCurrentPrompt(char *CurrentPrompt);
diff --git a/scilab/modules/shell/includes/promptecho.h b/scilab/modules/shell/includes/promptecho.h
new file mode 100644 (file)
index 0000000..d37f939
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+* Copyright (C) DIGITEO - 2009 - Allan CORNET
+* 
+* This file must be used under the terms of the CeCILL.
+* This source file is licensed as described in the file COPYING, which
+* you should have received as part of this distribution.  The terms
+* are also available at    
+* http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+*
+*/
+
+/*--------------------------------------------------------------------------*/ 
+#ifndef __PROMPTECHO_H__
+#define __PROMPTECHO_H__
+
+#include "machine.h"
+
+int C2F(promptecho)(int *lunit, char *string, int *strl,int string_len);
+
+#endif /* __PROMPTECHO_H__ */
+/*--------------------------------------------------------------------------*/ 
index 913f778..47bf46a 100644 (file)
@@ -1,6 +1,7 @@
 /*
  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) {2007 - INRIA - Allan CORNET
+ * Copyright (C) 2007 - INRIA - Allan CORNET
+ * Copyright (C) 2009 - DIGITEO - Allan CORNET
  * 
  * This file must be used under the terms of the CeCILL.
  * This source file is licensed as described in the file COPYING, which
@@ -16,8 +17,6 @@
 #include "Scierror.h"
 #include "localization.h"
 /*--------------------------------------------------------------------------*/
-#define PROMPT_SIZE_MAX 64
-/*--------------------------------------------------------------------------*/
 int C2F(sci_prompt)(char *fname,unsigned long fname_len)
 {
        char currentPrompt[PROMPT_SIZE_MAX];
@@ -25,7 +24,7 @@ int C2F(sci_prompt)(char *fname,unsigned long fname_len)
        int outIndex = 0 ;
 
        CheckRhs(0,1);
-       CheckLhs(0,1);
+       CheckLhs(0,2);
 
        if (Rhs == 0) /* Get current Scilab prompt */
        {
@@ -33,38 +32,51 @@ int C2F(sci_prompt)(char *fname,unsigned long fname_len)
             
                m1= (int)strlen(currentPrompt);
                n1=1;
-            
                CreateVar( Rhs+1,STRING_DATATYPE,&m1,&n1,&outIndex);
                strcpy(cstk(outIndex), currentPrompt);
+
+               if (Lhs == 2)
+               {
+                       m1 = 1;
+                       n1 = 1;
+                       l1 = 0;
+
+                       CreateVar( Rhs+2, MATRIX_OF_INTEGER_DATATYPE, &m1, &n1, &l1 );
+                       *istk(l1) = (int)C2F(recu).paus ;
+               }
             
                LhsVar(1) = Rhs+1;
+               if (Lhs == 2) LhsVar(2) = Rhs+2;
                C2F(putlhsvar)();
        }
        else /* Tempory change of Scilab prompt */
        {
-               if (VarType(1) != sci_strings)
+               if (Lhs <=1)
                {
-                       Scierror(999, _("%s: Wrong type for input argument #%d: A string expected.\n"), fname,1);
-                       return FALSE;
-               }
+                       if (VarType(1) != sci_strings)
+                       {
+                               Scierror(999, _("%s: Wrong type for input argument #%d: A string expected.\n"), fname,1);
+                               return FALSE;
+                       }
 
-               GetRhsVar(1,STRING_DATATYPE,&m1,&n1,&l1);
-            
-               if (n1 != 1)
+                       GetRhsVar(1,STRING_DATATYPE,&m1,&n1,&l1);
+
+                       if (n1 != 1)
+                       {
+                               Scierror(999, _("%s: Wrong size for input argument #%d: A string expected.\n"), fname,1);
+                               return FALSE;
+                       }
+
+                       SetTemporaryPrompt(cstk(l1));
+
+                       LhsVar(1) = 0;
+                       C2F(putlhsvar)();
+               }
+               else
                {
-                       Scierror(999, _("%s: Wrong size for input argument #%d: A string expected.\n"), fname,1);
-                       return FALSE;
+                       Scierror(999, _("%s: Wrong number of output argument(s).\n"), fname);
                }
-            
-               SetTemporaryPrompt(cstk(l1));
-
-               m1=0; n1=0;
-               CreateVar(Rhs+1,MATRIX_OF_DOUBLE_DATATYPE,&m1,&n1,&l1);
-            
-               LhsVar(1) = Rhs+1;
-               C2F(putlhsvar)();
        }
-
        return 0;
 }
 /*--------------------------------------------------------------------------*/
index 94f955f..ea44486 100644 (file)
@@ -29,6 +29,7 @@
 #include "GetCommandLine.h"
 #include "TermReadAndProcess.h"
 #include "stack-def.h"
+#include "diary.h"
 
 #ifdef _MSC_VER
 #define IMPORT_SIGNAL __declspec(dllimport)
@@ -39,7 +40,7 @@
 
 
 /*--------------------------------------------------------------------------*/
-static char Sci_Prompt[10];
+static char Sci_Prompt[PROMPT_SIZE_MAX];
 static char* tmpPrompt = NULL;
 static char * __CommandLine;
 /*--------------------------------------------------------------------------*/
@@ -73,7 +74,8 @@ static void getCommandLine(void)
       if (tmpPrompt != NULL)
         {
           SetConsolePrompt(tmpPrompt);
-          ClearTemporaryPrompt();
+
+                 if (getdiary() == 0) ClearTemporaryPrompt();
         }
       else
         {
index 601efb5..44e88cd 100644 (file)
@@ -10,8 +10,8 @@ getScilabMode
 callFunctionFromGateway
 com_
 iop_
+recu_
 sigbas_
-IsFromC
 putlhsvar_
 intersci_
 stack_
@@ -22,10 +22,7 @@ checklhs_
 checkrhs_
 createvar_
 createvarfromptr_
-GetCurrentPrompt
-SetTemporaryPrompt
-GetTemporaryPrompt
-ClearTemporaryPrompt
 set_is_reading
 freeArrayOfString
-vartype_
\ No newline at end of file
+vartype_
+getWarningMode
diff --git a/scilab/modules/shell/src/c/fileio_Import.def b/scilab/modules/shell/src/c/fileio_Import.def
new file mode 100644 (file)
index 0000000..dfcdab6
--- /dev/null
@@ -0,0 +1,4 @@
+       LIBRARY    fileio.dll
+
+EXPORTS 
+  getdiary
\ No newline at end of file
index 2e0e315..9563d61 100644 (file)
@@ -270,7 +270,7 @@ char *TermReadAndProcess(void)
   int character_count;
   char wk_buf[WK_BUF_SIZE + 1];
 
-  char *buffer;
+  char *buffer = NULL;
 
   tmpPrompt = GetTemporaryPrompt(); /* Input function has been used ? */
   GetCurrentPrompt(Sci_Prompt);
@@ -307,7 +307,7 @@ char *TermReadAndProcess(void)
       if(tmpPrompt!=NULL)
         {
           printf("%s",tmpPrompt);
-          ClearTemporaryPrompt();
+          if (getdiary() == 0) ClearTemporaryPrompt();
         }
       else
         {
@@ -684,7 +684,7 @@ static void displayPrompt(char *wk_buf)
        if (tmpPrompt!=NULL)
        {
                sprintf(msg,"%s\r\n%s%s",msg,tmpPrompt,wk_buf);
-               ClearTemporaryPrompt();
+               if (getdiary() == 0) ClearTemporaryPrompt();
        }
        else
        {
similarity index 92%
rename from scilab/modules/core/src/c/prompt.c
rename to scilab/modules/shell/src/c/prompt.c
index 85006e7..5a0683e 100644 (file)
 #ifdef _MSC_VER
 #include "strdup_Windows.h"
 #endif
+#include "BOOL.h"
 /*------------------------------------------------------------------------*/
-static char Sci_Prompt[10];
-static BOOL dispWarningLevelPrompt=TRUE;
-static char *temporaryPrompt=NULL;
+static char Sci_Prompt[PROMPT_SIZE_MAX];
+static BOOL dispWarningLevelPrompt = TRUE;
+static char *temporaryPrompt = NULL;
 /*------------------------------------------------------------------------*/
 /* setprlev : set the current prompt string */
 /*------------------------------------------------------------------------*/
@@ -36,7 +37,7 @@ void C2F(setprlev)( int *pause)
                        if (getWarningMode())
                        {
                                sciprint(_("Type '%s' or '%s' to return to standard level prompt.\n\n"),"resume","abort");
-                               dispWarningLevelPrompt=FALSE;
+                               dispWarningLevelPrompt = FALSE;
                        }
                }
                sprintf(Sci_Prompt,SCIPROMPT_INTERRUPT,*pause);
diff --git a/scilab/modules/shell/src/c/promptecho.c b/scilab/modules/shell/src/c/promptecho.c
new file mode 100644 (file)
index 0000000..608209d
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+* Copyright (C) DIGITEO - 2009 - Allan CORNET
+* 
+* This file must be used under the terms of the CeCILL.
+* This source file is licensed as described in the file COPYING, which
+* you should have received as part of this distribution.  The terms
+* are also available at    
+* http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+*
+*/
+/*--------------------------------------------------------------------------*/ 
+#include <stdio.h>
+#include "stack-def.h"
+#include "promptecho.h"
+#include "basout.h"
+#include "MALLOC.h"
+#include "prompt.h"
+#include "diary.h"
+#ifdef _MSC_VER
+#include "strdup_Windows.h"
+#endif
+/*--------------------------------------------------------------------------*/ 
+int C2F(promptecho)(int *lunit, char *string, int *strl,int string_len)
+{
+       char *promptstr = NULL;
+       char *buffstr =  NULL;
+       int lenbuffstr = 0;
+
+       if (GetTemporaryPrompt())
+       {
+               promptstr = strdup(GetTemporaryPrompt());
+                if (getdiary() != 0) ClearTemporaryPrompt();
+       }
+       else
+       {
+               promptstr = (char*)MALLOC(sizeof(char)*(PROMPT_SIZE_MAX+1));
+               GetCurrentPrompt(promptstr);
+       }
+
+       /* concates prompt with input command line */
+       if (promptstr)
+       {
+               lenbuffstr = (int) ( strlen(string) + strlen(promptstr) );
+               buffstr = (char*) MALLOC(sizeof(char)* (lenbuffstr + 1));
+               if (buffstr)
+               {
+                       strcpy(buffstr,promptstr);
+                       strcat(buffstr,string);
+               }
+               FREE(promptstr);
+               promptstr = NULL;
+       }
+
+       /* displays command line with prompt */
+       if (buffstr)
+       {
+               int io = 0;
+               C2F(basout)(&io, lunit, buffstr,lenbuffstr);
+               FREE(buffstr);
+               buffstr = NULL;
+       }
+       return 0;
+}
+/*--------------------------------------------------------------------------*/ 
index 23245ee..7aae7ce 100644 (file)
@@ -44,7 +44,7 @@
                        <Tool
                                Name="VCCLCompilerTool"
                                Optimization="0"
-                               AdditionalIncludeDirectories=".;windows;../../includes;../../../../libs/MALLOC/includes;../../../localization/includes;../../../../libs/intl;../../../console/includes/;../../../windows_tools/includes;../../../core/includes;../../../completion/includes;../../../output_stream/includes;../../../../java/jdk/include;../../../../java/jdk/include/win32;../../../history_manager/includes/;../../../action_binding/includes"
+                               AdditionalIncludeDirectories=".;windows;../../includes;../../../../libs/MALLOC/includes;../../../localization/includes;../../../../libs/intl;../../../console/includes/;../../../windows_tools/includes;../../../core/includes;../../../completion/includes;../../../output_stream/includes;../../../../java/jdk/include;../../../../java/jdk/include/win32;../../../history_manager/includes/;../../../action_binding/includes;../../../fileio/includes"
                                PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;FORDLL;_DEBUG;_WINDOWS;_USRDLL;CONSOLE_EXPORTS"
                                MinimalRebuild="true"
                                BasicRuntimeChecks="0"
                        <Tool
                                Name="VCPreLinkEventTool"
                                Description="Make dependencies"
-                               CommandLine="lib /DEF:&quot;$(InputDir)LibScilab_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X86 /OUT:&quot;$(InputDir)LibScilab.lib&quot; 1&gt;NUL 2&gt;NUL&#x0D;&#x0A;lib /DEF:&quot;$(InputDir)libjvm_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X86 /OUT:&quot;$(InputDir)libjvm.lib&quot; 1&gt;NUL 2&gt;NUL&#x0D;&#x0A;lib /DEF:&quot;$(InputDir)sciconsole_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X86 /OUT:&quot;$(InputDir)sciconsole.lib&quot; 1&gt;NUL 2&gt;NUL&#x0D;&#x0A;lib /DEF:&quot;$(InputDir)scilab_windows_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X86 /OUT:&quot;$(InputDir)scilab_windows.lib&quot; 1&gt;NUL 2&gt;NUL&#x0D;&#x0A;lib /DEF:&quot;$(InputDir)scicompletion_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X86 /OUT:&quot;$(InputDir)scicompletion.lib&quot; 1&gt;NUL 2&gt;NUL&#x0D;&#x0A;lib /DEF:&quot;$(InputDir)localization_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X86 /OUT:&quot;$(InputDir)scilocalization.lib&quot; 1&gt;NUL 2&gt;NUL&#x0D;&#x0A;cd $(IntDir) &gt;nul&#x0D;&#x0A;for %%f in (*.obj) do  ..\..\..\..\..\bin\dumpexts -o %%~nf.def -n libshell.dll %%f &gt;nul&#x0D;&#x0A;copy *.def shelltmp.def &gt;nul&#x0D;&#x0A;copy ..\shell_header.def+shelltmp.def  ..\shell.def &gt;nul&#x0D;&#x0A;del *.def &gt;nul&#x0D;&#x0A;cd .. &gt;nul&#x0D;&#x0A;"
+                               CommandLine="lib /DEF:&quot;$(InputDir)LibScilab_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X86 /OUT:&quot;$(InputDir)LibScilab.lib&quot; 1&gt;NUL 2&gt;NUL&#x0D;&#x0A;lib /DEF:&quot;$(InputDir)libjvm_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X86 /OUT:&quot;$(InputDir)libjvm.lib&quot; 1&gt;NUL 2&gt;NUL&#x0D;&#x0A;lib /DEF:&quot;$(InputDir)sciconsole_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X86 /OUT:&quot;$(InputDir)sciconsole.lib&quot; 1&gt;NUL 2&gt;NUL&#x0D;&#x0A;lib /DEF:&quot;$(InputDir)scilab_windows_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X86 /OUT:&quot;$(InputDir)scilab_windows.lib&quot; 1&gt;NUL 2&gt;NUL&#x0D;&#x0A;lib /DEF:&quot;$(InputDir)scicompletion_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X86 /OUT:&quot;$(InputDir)scicompletion.lib&quot; 1&gt;NUL 2&gt;NUL&#x0D;&#x0A;lib /DEF:&quot;$(InputDir)localization_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X86 /OUT:&quot;$(InputDir)scilocalization.lib&quot; 1&gt;NUL 2&gt;NUL&#x0D;&#x0A;lib /DEF:&quot;$(InputDir)fileio_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X86 /OUT:&quot;$(InputDir)fileio.lib&quot; 1&gt;NUL 2&gt;NUL&#x0D;&#x0A;cd $(IntDir) &gt;nul&#x0D;&#x0A;for %%f in (*.obj) do  ..\..\..\..\..\bin\dumpexts -o %%~nf.def -n libshell.dll %%f &gt;nul&#x0D;&#x0A;copy *.def shelltmp.def &gt;nul&#x0D;&#x0A;copy ..\shell_header.def+shelltmp.def  ..\shell.def &gt;nul&#x0D;&#x0A;del *.def &gt;nul&#x0D;&#x0A;cd .. &gt;nul&#x0D;&#x0A;"
                        />
                        <Tool
                                Name="VCLinkerTool"
-                               AdditionalDependencies="LibScilab.lib libjvm.lib sciconsole.lib scilab_windows.lib scicompletion.lib scilocalization.lib"
+                               AdditionalDependencies="LibScilab.lib libjvm.lib sciconsole.lib scilab_windows.lib scicompletion.lib fileio.lib scilocalization.lib"
                                OutputFile="../../../../bin/libshell.dll"
                                LinkIncremental="1"
                                ModuleDefinitionFile="shell.def"
                        <Tool
                                Name="VCCLCompilerTool"
                                Optimization="0"
-                               AdditionalIncludeDirectories=".;windows;../../includes;../../../../libs/MALLOC/includes;../../../localization/includes;../../../../libs/intl;../../../console/includes/;../../../windows_tools/includes;../../../core/includes;../../../completion/includes;../../../output_stream/includes;../../../../java/jdk/include;../../../../java/jdk/include/win32;../../../history_manager/includes/;../../../action_binding/includes"
+                               AdditionalIncludeDirectories=".;windows;../../includes;../../../../libs/MALLOC/includes;../../../localization/includes;../../../../libs/intl;../../../console/includes/;../../../windows_tools/includes;../../../core/includes;../../../completion/includes;../../../output_stream/includes;../../../../java/jdk/include;../../../../java/jdk/include/win32;../../../history_manager/includes/;../../../action_binding/includes;../../../fileio/includes"
                                PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;FORDLL;_DEBUG;_WINDOWS;_USRDLL;CONSOLE_EXPORTS"
                                MinimalRebuild="true"
                                BasicRuntimeChecks="0"
                        <Tool
                                Name="VCPreLinkEventTool"
                                Description="Make dependencies"
-                               CommandLine="lib /DEF:&quot;$(InputDir)LibScilab_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X64 /OUT:&quot;$(InputDir)LibScilab.lib&quot; 1&gt;NUL 2&gt;NUL&#x0D;&#x0A;lib /DEF:&quot;$(InputDir)libjvm_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X64 /OUT:&quot;$(InputDir)libjvm.lib&quot; 1&gt;NUL 2&gt;NUL&#x0D;&#x0A;lib /DEF:&quot;$(InputDir)sciconsole_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X64 /OUT:&quot;$(InputDir)sciconsole.lib&quot; 1&gt;NUL 2&gt;NUL&#x0D;&#x0A;lib /DEF:&quot;$(InputDir)scilab_windows_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X64 /OUT:&quot;$(InputDir)scilab_windows.lib&quot; 1&gt;NUL 2&gt;NUL&#x0D;&#x0A;lib /DEF:&quot;$(InputDir)scicompletion_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X64 /OUT:&quot;$(InputDir)scicompletion.lib&quot; 1&gt;NUL 2&gt;NUL&#x0D;&#x0A;lib /DEF:&quot;$(InputDir)localization_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X64 /OUT:&quot;$(InputDir)scilocalization.lib&quot; 1&gt;NUL 2&gt;NUL&#x0D;&#x0A;cd $(IntDir) &gt;nul&#x0D;&#x0A;for %%f in (*.obj) do  ..\..\..\..\..\bin\dumpexts -o %%~nf.def -n libshell.dll %%f &gt;nul&#x0D;&#x0A;copy *.def shelltmp.def &gt;nul&#x0D;&#x0A;copy ..\shell_header.def+shelltmp.def  ..\shell.def &gt;nul&#x0D;&#x0A;del *.def &gt;nul&#x0D;&#x0A;cd .. &gt;nul&#x0D;&#x0A;"
+                               CommandLine="lib /DEF:&quot;$(InputDir)LibScilab_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X64 /OUT:&quot;$(InputDir)LibScilab.lib&quot; 1&gt;NUL 2&gt;NUL&#x0D;&#x0A;lib /DEF:&quot;$(InputDir)libjvm_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X64 /OUT:&quot;$(InputDir)libjvm.lib&quot; 1&gt;NUL 2&gt;NUL&#x0D;&#x0A;lib /DEF:&quot;$(InputDir)sciconsole_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X64 /OUT:&quot;$(InputDir)sciconsole.lib&quot; 1&gt;NUL 2&gt;NUL&#x0D;&#x0A;lib /DEF:&quot;$(InputDir)scilab_windows_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X64 /OUT:&quot;$(InputDir)scilab_windows.lib&quot; 1&gt;NUL 2&gt;NUL&#x0D;&#x0A;lib /DEF:&quot;$(InputDir)scicompletion_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X64 /OUT:&quot;$(InputDir)scicompletion.lib&quot; 1&gt;NUL 2&gt;NUL&#x0D;&#x0A;lib /DEF:&quot;$(InputDir)localization_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X64 /OUT:&quot;$(InputDir)scilocalization.lib&quot; 1&gt;NUL 2&gt;NUL&#x0D;&#x0A;lib /DEF:&quot;$(InputDir)fileio_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X64 /OUT:&quot;$(InputDir)fileio.lib&quot; 1&gt;NUL 2&gt;NUL&#x0D;&#x0A;cd $(IntDir) &gt;nul&#x0D;&#x0A;for %%f in (*.obj) do  ..\..\..\..\..\bin\dumpexts -o %%~nf.def -n libshell.dll %%f &gt;nul&#x0D;&#x0A;copy *.def shelltmp.def &gt;nul&#x0D;&#x0A;copy ..\shell_header.def+shelltmp.def  ..\shell.def &gt;nul&#x0D;&#x0A;del *.def &gt;nul&#x0D;&#x0A;cd .. &gt;nul&#x0D;&#x0A;"
                        />
                        <Tool
                                Name="VCLinkerTool"
-                               AdditionalDependencies="LibScilab.lib libjvm.lib sciconsole.lib scilab_windows.lib scicompletion.lib scilocalization.lib"
+                               AdditionalDependencies="LibScilab.lib libjvm.lib sciconsole.lib scilab_windows.lib scicompletion.lib fileio.lib scilocalization.lib"
                                OutputFile="../../../../bin/libshell.dll"
                                LinkIncremental="1"
                                ModuleDefinitionFile="shell.def"
                                InlineFunctionExpansion="1"
                                FavorSizeOrSpeed="1"
                                WholeProgramOptimization="false"
-                               AdditionalIncludeDirectories=".;windows;../../includes;../../../../libs/MALLOC/includes;../../../localization/includes;../../../../libs/intl;../../../console/includes/;../../../windows_tools/includes;../../../core/includes;../../../completion/includes;../../../output_stream/includes;../../../../java/jdk/include;../../../../java/jdk/include/win32;../../../history_manager/includes/;../../../action_binding/includes"
+                               AdditionalIncludeDirectories=".;windows;../../includes;../../../../libs/MALLOC/includes;../../../localization/includes;../../../../libs/intl;../../../console/includes/;../../../windows_tools/includes;../../../core/includes;../../../completion/includes;../../../output_stream/includes;../../../../java/jdk/include;../../../../java/jdk/include/win32;../../../history_manager/includes/;../../../action_binding/includes;../../../fileio/includes"
                                PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;FORDLL;NDEBUG;_WINDOWS;_USRDLL;CONSOLE_EXPORTS"
                                StringPooling="true"
                                RuntimeLibrary="2"
                        <Tool
                                Name="VCPreLinkEventTool"
                                Description="Make dependencies"
-                               CommandLine="lib /DEF:&quot;$(InputDir)LibScilab_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X86 /OUT:&quot;$(InputDir)LibScilab.lib&quot; 1&gt;NUL 2&gt;NUL&#x0D;&#x0A;lib /DEF:&quot;$(InputDir)libjvm_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X86 /OUT:&quot;$(InputDir)libjvm.lib&quot; 1&gt;NUL 2&gt;NUL&#x0D;&#x0A;lib /DEF:&quot;$(InputDir)sciconsole_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X86 /OUT:&quot;$(InputDir)sciconsole.lib&quot; 1&gt;NUL 2&gt;NUL&#x0D;&#x0A;lib /DEF:&quot;$(InputDir)scilab_windows_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X86 /OUT:&quot;$(InputDir)scilab_windows.lib&quot; 1&gt;NUL 2&gt;NUL&#x0D;&#x0A;lib /DEF:&quot;$(InputDir)scicompletion_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X86 /OUT:&quot;$(InputDir)scicompletion.lib&quot; 1&gt;NUL 2&gt;NUL&#x0D;&#x0A;lib /DEF:&quot;$(InputDir)localization_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X86 /OUT:&quot;$(InputDir)scilocalization.lib&quot; 1&gt;NUL 2&gt;NUL&#x0D;&#x0A;cd $(IntDir) &gt;nul&#x0D;&#x0A;for %%f in (*.obj) do  ..\..\..\..\..\bin\dumpexts -o %%~nf.def -n libshell.dll %%f &gt;nul&#x0D;&#x0A;copy *.def shelltmp.def &gt;nul&#x0D;&#x0A;copy ..\shell_header.def+shelltmp.def  ..\shell.def &gt;nul&#x0D;&#x0A;del *.def &gt;nul&#x0D;&#x0A;cd .. &gt;nul&#x0D;&#x0A;"
+                               CommandLine="lib /DEF:&quot;$(InputDir)LibScilab_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X86 /OUT:&quot;$(InputDir)LibScilab.lib&quot; 1&gt;NUL 2&gt;NUL&#x0D;&#x0A;lib /DEF:&quot;$(InputDir)libjvm_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X86 /OUT:&quot;$(InputDir)libjvm.lib&quot; 1&gt;NUL 2&gt;NUL&#x0D;&#x0A;lib /DEF:&quot;$(InputDir)sciconsole_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X86 /OUT:&quot;$(InputDir)sciconsole.lib&quot; 1&gt;NUL 2&gt;NUL&#x0D;&#x0A;lib /DEF:&quot;$(InputDir)scilab_windows_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X86 /OUT:&quot;$(InputDir)scilab_windows.lib&quot; 1&gt;NUL 2&gt;NUL&#x0D;&#x0A;lib /DEF:&quot;$(InputDir)scicompletion_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X86 /OUT:&quot;$(InputDir)scicompletion.lib&quot; 1&gt;NUL 2&gt;NUL&#x0D;&#x0A;lib /DEF:&quot;$(InputDir)localization_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X86 /OUT:&quot;$(InputDir)scilocalization.lib&quot; 1&gt;NUL 2&gt;NUL&#x0D;&#x0A;lib /DEF:&quot;$(InputDir)fileio_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X86 /OUT:&quot;$(InputDir)fileio.lib&quot; 1&gt;NUL 2&gt;NUL&#x0D;&#x0A;cd $(IntDir) &gt;nul&#x0D;&#x0A;for %%f in (*.obj) do  ..\..\..\..\..\bin\dumpexts -o %%~nf.def -n libshell.dll %%f &gt;nul&#x0D;&#x0A;copy *.def shelltmp.def &gt;nul&#x0D;&#x0A;copy ..\shell_header.def+shelltmp.def  ..\shell.def &gt;nul&#x0D;&#x0A;del *.def &gt;nul&#x0D;&#x0A;cd .. &gt;nul&#x0D;&#x0A;"
                        />
                        <Tool
                                Name="VCLinkerTool"
-                               AdditionalDependencies="LibScilab.lib libjvm.lib sciconsole.lib scilab_windows.lib scicompletion.lib scilocalization.lib"
+                               AdditionalDependencies="LibScilab.lib libjvm.lib sciconsole.lib scilab_windows.lib scicompletion.lib fileio.lib scilocalization.lib"
                                OutputFile="../../../../bin/libshell.dll"
                                LinkIncremental="1"
                                ModuleDefinitionFile="shell.def"
                                InlineFunctionExpansion="1"
                                FavorSizeOrSpeed="1"
                                WholeProgramOptimization="false"
-                               AdditionalIncludeDirectories=".;windows;../../includes;../../../../libs/MALLOC/includes;../../../localization/includes;../../../../libs/intl;../../../console/includes/;../../../windows_tools/includes;../../../core/includes;../../../completion/includes;../../../output_stream/includes;../../../../java/jdk/include;../../../../java/jdk/include/win32;../../../history_manager/includes/;../../../action_binding/includes"
+                               AdditionalIncludeDirectories=".;windows;../../includes;../../../../libs/MALLOC/includes;../../../localization/includes;../../../../libs/intl;../../../console/includes/;../../../windows_tools/includes;../../../core/includes;../../../completion/includes;../../../output_stream/includes;../../../../java/jdk/include;../../../../java/jdk/include/win32;../../../history_manager/includes/;../../../action_binding/includes;../../../fileio/includes"
                                PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;FORDLL;NDEBUG;_WINDOWS;_USRDLL;CONSOLE_EXPORTS"
                                StringPooling="true"
                                RuntimeLibrary="2"
                        <Tool
                                Name="VCPreLinkEventTool"
                                Description="Make dependencies"
-                               CommandLine="lib /DEF:&quot;$(InputDir)LibScilab_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X64 /OUT:&quot;$(InputDir)LibScilab.lib&quot; 1&gt;NUL 2&gt;NUL&#x0D;&#x0A;lib /DEF:&quot;$(InputDir)libjvm_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X64 /OUT:&quot;$(InputDir)libjvm.lib&quot; 1&gt;NUL 2&gt;NUL&#x0D;&#x0A;lib /DEF:&quot;$(InputDir)sciconsole_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X64 /OUT:&quot;$(InputDir)sciconsole.lib&quot; 1&gt;NUL 2&gt;NUL&#x0D;&#x0A;lib /DEF:&quot;$(InputDir)scilab_windows_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X64 /OUT:&quot;$(InputDir)scilab_windows.lib&quot; 1&gt;NUL 2&gt;NUL&#x0D;&#x0A;lib /DEF:&quot;$(InputDir)scicompletion_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X64 /OUT:&quot;$(InputDir)scicompletion.lib&quot; 1&gt;NUL 2&gt;NUL&#x0D;&#x0A;lib /DEF:&quot;$(InputDir)localization_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X64 /OUT:&quot;$(InputDir)scilocalization.lib&quot; 1&gt;NUL 2&gt;NUL&#x0D;&#x0A;cd $(IntDir) &gt;nul&#x0D;&#x0A;for %%f in (*.obj) do  ..\..\..\..\..\bin\dumpexts -o %%~nf.def -n libshell.dll %%f &gt;nul&#x0D;&#x0A;copy *.def shelltmp.def &gt;nul&#x0D;&#x0A;copy ..\shell_header.def+shelltmp.def  ..\shell.def &gt;nul&#x0D;&#x0A;del *.def &gt;nul&#x0D;&#x0A;cd .. &gt;nul&#x0D;&#x0A;"
+                               CommandLine="lib /DEF:&quot;$(InputDir)LibScilab_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X64 /OUT:&quot;$(InputDir)LibScilab.lib&quot; 1&gt;NUL 2&gt;NUL&#x0D;&#x0A;lib /DEF:&quot;$(InputDir)libjvm_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X64 /OUT:&quot;$(InputDir)libjvm.lib&quot; 1&gt;NUL 2&gt;NUL&#x0D;&#x0A;lib /DEF:&quot;$(InputDir)sciconsole_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X64 /OUT:&quot;$(InputDir)sciconsole.lib&quot; 1&gt;NUL 2&gt;NUL&#x0D;&#x0A;lib /DEF:&quot;$(InputDir)scilab_windows_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X64 /OUT:&quot;$(InputDir)scilab_windows.lib&quot; 1&gt;NUL 2&gt;NUL&#x0D;&#x0A;lib /DEF:&quot;$(InputDir)scicompletion_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X64 /OUT:&quot;$(InputDir)scicompletion.lib&quot; 1&gt;NUL 2&gt;NUL&#x0D;&#x0A;lib /DEF:&quot;$(InputDir)localization_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X64 /OUT:&quot;$(InputDir)scilocalization.lib&quot; 1&gt;NUL 2&gt;NUL&#x0D;&#x0A;lib /DEF:&quot;$(InputDir)fileio_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X64 /OUT:&quot;$(InputDir)fileio.lib&quot; 1&gt;NUL 2&gt;NUL&#x0D;&#x0A;cd $(IntDir) &gt;nul&#x0D;&#x0A;for %%f in (*.obj) do  ..\..\..\..\..\bin\dumpexts -o %%~nf.def -n libshell.dll %%f &gt;nul&#x0D;&#x0A;copy *.def shelltmp.def &gt;nul&#x0D;&#x0A;copy ..\shell_header.def+shelltmp.def  ..\shell.def &gt;nul&#x0D;&#x0A;del *.def &gt;nul&#x0D;&#x0A;cd .. &gt;nul&#x0D;&#x0A;"
                        />
                        <Tool
                                Name="VCLinkerTool"
-                               AdditionalDependencies="LibScilab.lib libjvm.lib sciconsole.lib scilab_windows.lib scicompletion.lib scilocalization.lib"
+                               AdditionalDependencies="LibScilab.lib libjvm.lib sciconsole.lib scilab_windows.lib scicompletion.lib fileio.lib scilocalization.lib"
                                OutputFile="../../../../bin/libshell.dll"
                                LinkIncremental="1"
                                ModuleDefinitionFile="shell.def"
                                >
                        </File>
                        <File
+                               RelativePath=".\prompt.c"
+                               >
+                       </File>
+                       <File
+                               RelativePath=".\promptecho.c"
+                               >
+                       </File>
+                       <File
                                RelativePath="..\..\sci_gateway\c\sci_clc.c"
                                >
                        </File>
                                >
                        </File>
                        <File
+                               RelativePath="..\..\includes\prompt.h"
+                               >
+                       </File>
+                       <File
+                               RelativePath="..\..\includes\promptecho.h"
+                               >
+                       </File>
+                       <File
                                RelativePath=".\resource.h"
                                >
                        </File>
index 084a6d8..9c63c44 100644 (file)
 #include "MALLOC.h"
 #include "prompt.h"
 #include "TermConsole.h"
+#include "diary.h"
 /*--------------------------------------------------------------------------*/
 static char *returnedline = NULL;
 /*--------------------------------------------------------------------------*/
 char * TermReadAndProcess(void)
 {
-       static char save_prompt[10];
+       static char save_prompt[PROMPT_SIZE_MAX];
 
        /* free previous line */
        if (returnedline) {FREE(returnedline);returnedline = NULL;}
@@ -29,7 +30,7 @@ char * TermReadAndProcess(void)
     if (GetTemporaryPrompt() != NULL) /* Input function is used */
     {
                returnedline = TerminalGetString(GetTemporaryPrompt());
-        ClearTemporaryPrompt();
+        if (getdiary() == 0) ClearTemporaryPrompt();
        }
        else
        {