move disp in output_stream
Allan CORNET [Wed, 6 May 2009 13:58:59 +0000 (15:58 +0200)]
27 files changed:
scilab/CHANGES_5.2.X
scilab/modules/io/Makefile.am
scilab/modules/io/includes/gw_io.h
scilab/modules/io/sci_gateway/c/gw_io.c
scilab/modules/io/sci_gateway/io_gateway.xml
scilab/modules/io/src/c/io.vcproj
scilab/modules/io/src/c/io_f_Import.def
scilab/modules/io/src/fortran/io_f.vfproj
scilab/modules/io/src/fortran/io_f2c.vcproj
scilab/modules/output_stream/Makefile.am
scilab/modules/output_stream/help/en_US/disp.xml [moved from scilab/modules/io/help/en_US/disp.xml with 100% similarity]
scilab/modules/output_stream/includes/gw_output_stream.h
scilab/modules/output_stream/sci_gateway/c/gw_output_stream.c
scilab/modules/output_stream/sci_gateway/c/sci_disp.c [moved from scilab/modules/io/sci_gateway/c/sci_disp.c with 72% similarity]
scilab/modules/output_stream/sci_gateway/fortran/intdisp.f [moved from scilab/modules/io/sci_gateway/fortran/intdisp.f with 100% similarity]
scilab/modules/output_stream/sci_gateway/output_stream_gateway.xml
scilab/modules/output_stream/src/c/output_stream.vcproj
scilab/modules/output_stream/src/c/output_stream_f_Import.def
scilab/modules/output_stream/src/fortran/LibScilab_Import.def
scilab/modules/output_stream/src/fortran/output_stream_f.vfproj
scilab/modules/output_stream/src/fortran/output_stream_f2c.vcproj
scilab/modules/output_stream/tests/nonreg_tests/bug_2602.dia.ref [moved from scilab/modules/io/tests/nonreg_tests/bug_2602.dia.ref with 100% similarity]
scilab/modules/output_stream/tests/nonreg_tests/bug_2602.tst [moved from scilab/modules/io/tests/nonreg_tests/bug_2602.tst with 100% similarity]
scilab/modules/output_stream/tests/unit_tests/disp.dia.ref [new file with mode: 0644]
scilab/modules/output_stream/tests/unit_tests/disp.tst [new file with mode: 0644]
scilab/modules/output_stream/tests/unit_tests/printf.dia.ref [moved from scilab/modules/io/tests/unit_tests/printf.dia.ref with 100% similarity]
scilab/modules/output_stream/tests/unit_tests/printf.tst [moved from scilab/modules/io/tests/unit_tests/printf.tst with 100% similarity]

index 715e5f2..c6bf7df 100644 (file)
@@ -26,6 +26,8 @@ Source reorganisation:
 
 * printf, msprintf, mprintf, print moved in output_stream module.
 
+* disp moved in output_stream module.
+
 Input/Output functions:
 =======================
 
index f7c36e2..691640f 100644 (file)
@@ -40,8 +40,7 @@ sci_gateway/c/sci_load.c \
 sci_gateway/c/sci_unix.c \
 sci_gateway/c/sci_getf.c \
 sci_gateway/c/sci_oldsave.c \
-sci_gateway/c/sci_save.c \
-sci_gateway/c/sci_disp.c
+sci_gateway/c/sci_save.c
 
 
 GATEWAY_CPP_SOURCES = sci_gateway/cpp/sci_export_to_hdf5.cpp 
@@ -53,7 +52,6 @@ sci_gateway/fortran/intgetf.f \
 sci_gateway/fortran/intrat.f \
 sci_gateway/fortran/intwritb.f \
 sci_gateway/fortran/intwrite.f \
-sci_gateway/fortran/intdisp.f \
 sci_gateway/fortran/intread4b.f \
 sci_gateway/fortran/intdeff.f \
 sci_gateway/fortran/intlib.f \
index baf9a7b..0c25691 100644 (file)
@@ -33,7 +33,6 @@ int C2F(sci_unix)(char *fname,unsigned long fname_len);
 int C2F(sci_readb)(char *fname,unsigned long fname_len);
 int C2F(sci_writb)(char *fname,unsigned long fname_len);
 int C2F(sci_execstr)(char *fname,unsigned long fname_len);
-int C2F(sci_disp)(char *fname,unsigned long fname_len);
 int C2F(sci_getpid)(char *fname,unsigned long fname_len);
 int C2F(sci_getenv)(char *fname,unsigned long fname_len);
 int C2F(sci_read4b)(char *fname,unsigned long fname_len);
@@ -50,7 +49,6 @@ int C2F(intload) (int *id1, int *k1); /* FORTRAN subroutine */
 int C2F(intexec) (char *fname,unsigned long fname_len);
 int C2F(intgetf)(void);
 int C2F(intsave)(void);
-int C2F(intdisp) (void);
 int C2F(intdiary)(void);
 int C2F(intdeff)(void);
 int C2F(intfile)(void);
index 71742d4..0c49435 100644 (file)
@@ -11,6 +11,7 @@
  */
 
 #include "gw_io.h"
+#include "gw_output_stream.h" /* sci_disp */
 #include "stack-c.h"
 #include "callFunctionFromGateway.h"
 /*--------------------------------------------------------------------------*/
@@ -32,7 +33,6 @@ static gw_generic_table Tab[]=
 {C2F(sci_readb),"readb"},
 {C2F(sci_writb),"writb"},
 {C2F(sci_execstr),"execstr"},
-{C2F(sci_disp),"disp"},
 {C2F(sci_getpid),"getpid"},
 {C2F(sci_getenv),"getenv"},
 {C2F(sci_read4b),"read4b"},
@@ -82,7 +82,8 @@ int gw_io(void)
                        }
                        case 7:
                        {
-                               C2F(intdisp)();
+                               #define disp_fname "disp"
+                               sci_disp(disp_fname,strlen(disp_fname));
                                return 0;
                        }
                        case 8: 
@@ -90,6 +91,8 @@ int gw_io(void)
                                C2F(intexec)("exec",(unsigned long)strlen("exec"));
                                return 0;
                        }
+                       default:
+                               return 0;
                }
        }
         else
index 1a54bb8..e1f6b7c 100644 (file)
 <PRIMITIVE gatewayId="5" primitiveId="14" primitiveName="readb" />
 <PRIMITIVE gatewayId="5" primitiveId="15" primitiveName="writb" />
 <PRIMITIVE gatewayId="5" primitiveId="16" primitiveName="execstr" />
-<PRIMITIVE gatewayId="5" primitiveId="17" primitiveName="disp" />
-<PRIMITIVE gatewayId="5" primitiveId="18" primitiveName="getpid" />
-<PRIMITIVE gatewayId="5" primitiveId="19" primitiveName="getenv" />
-<PRIMITIVE gatewayId="5" primitiveId="20" primitiveName="read4b" />
-<PRIMITIVE gatewayId="5" primitiveId="21" primitiveName="write4b" />
-<PRIMITIVE gatewayId="5" primitiveId="22" primitiveName="save" />
-<PRIMITIVE gatewayId="5" primitiveId="23" primitiveName="load" />
-<PRIMITIVE gatewayId="5" primitiveId="24" primitiveName="mgetl" />
-<PRIMITIVE gatewayId="5" primitiveId="25" primitiveName="getio" />
-<PRIMITIVE gatewayId="5" primitiveId="26" primitiveName="setenv" />
-<PRIMITIVE gatewayId="5" primitiveId="27" primitiveName="export_to_hdf5" />
+<PRIMITIVE gatewayId="5" primitiveId="17" primitiveName="getpid" />
+<PRIMITIVE gatewayId="5" primitiveId="18" primitiveName="getenv" />
+<PRIMITIVE gatewayId="5" primitiveId="19" primitiveName="read4b" />
+<PRIMITIVE gatewayId="5" primitiveId="20" primitiveName="write4b" />
+<PRIMITIVE gatewayId="5" primitiveId="21" primitiveName="save" />
+<PRIMITIVE gatewayId="5" primitiveId="22" primitiveName="load" />
+<PRIMITIVE gatewayId="5" primitiveId="23" primitiveName="mgetl" />
+<PRIMITIVE gatewayId="5" primitiveId="24" primitiveName="getio" />
+<PRIMITIVE gatewayId="5" primitiveId="25" primitiveName="setenv" />
+<PRIMITIVE gatewayId="5" primitiveId="26" primitiveName="export_to_hdf5" />
 </GATEWAY>
\ No newline at end of file
index fac374e..0c13a16 100644 (file)
                                >
                        </File>
                        <File
-                               RelativePath="..\..\sci_gateway\c\sci_disp.c"
-                               >
-                       </File>
-                       <File
                                RelativePath="..\..\sci_gateway\c\sci_exec.c"
                                >
                        </File>
index 6541c31..30a636a 100644 (file)
@@ -6,7 +6,6 @@ EXPORTS
 ; io_f
 ; --------------------------------------- 
        intdeff_
-       intdisp_
        intexec_
        intexecstr_
        intfile_
index d93fd52..4f31411 100644 (file)
@@ -77,7 +77,6 @@ lib /DEF:&quot;$(InputDir)output_stream_f_Import.def&quot; /SUBSYSTEM:WINDOWS /M
                <Filter Name="Resource Files" Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"/>
                <Filter Name="Source Files" Filter="f90;for;f;fpp;ftn;def;odl;idl">
                <File RelativePath="..\..\sci_gateway\fortran\intdeff.f"/>
-               <File RelativePath="..\..\sci_gateway\fortran\intdisp.f"/>
                <File RelativePath="..\..\sci_gateway\fortran\intexec.f"/>
                <File RelativePath="..\..\sci_gateway\fortran\intexecstr.f"/>
                <File RelativePath="..\..\sci_gateway\fortran\intfile.f"/>
index f0e422a..539c5fe 100644 (file)
                                >
                        </File>
                        <File
-                               RelativePath="..\..\sci_gateway\fortran\intdisp.c"
-                               >
-                       </File>
-                       <File
                                RelativePath="..\..\sci_gateway\fortran\intexec.c"
                                >
                        </File>
                                >
                        </File>
                        <File
-                               RelativePath="..\..\sci_gateway\fortran\intdisp.f"
-                               >
-                       </File>
-                       <File
                                RelativePath="..\..\sci_gateway\fortran\intexec.f"
                                >
                        </File>
index 10025ba..e0e56ad 100644 (file)
@@ -48,10 +48,12 @@ OUTPUT_STREAM_FORTRAN_SOURCES = src/fortran/wspdsp.f \
 GATEWAY_C_SOURCES = sci_gateway/c/gw_output_stream.c \
                sci_gateway/c/sci_print.c \
                sci_gateway/c/sci_mprintf.c \
-               sci_gateway/c/sci_msprintf.c
+               sci_gateway/c/sci_msprintf.c \
+               sci_gateway/c/sci_disp.c
                
 
-GATEWAY_FORTRAN_SOURCES = sci_gateway/fortran/intprint.f
+GATEWAY_FORTRAN_SOURCES = sci_gateway/fortran/intprint.f \
+                       sci_gateway/fortran/intdisp.f
 
 libscioutput_stream_la_CFLAGS=  -I$(top_srcdir)/libs/MALLOC/includes/ \
 -I$(srcdir)/includes/ \
index 81b2ee4..f47facd 100644 (file)
@@ -18,6 +18,7 @@ int gw_output_stream(void);
 int sci_print(char *fname,unsigned long fname_len);
 int sci_mprintf(char *fname,unsigned long fname_len);
 int sci_msprintf(char *fname,unsigned long fname_len);
+int sci_disp(char *fname,unsigned long fname_len);
 /*--------------------------------------------------------------------------*/
 #endif /* __GW_OUTPUT_STREAM_H__ */
 /*--------------------------------------------------------------------------*/
index a52dc03..f570e42 100644 (file)
@@ -18,7 +18,8 @@
 static gw_generic_table Tab[]={ 
        {sci_print, "print"},
        {sci_mprintf, "mprintf"},
-       {sci_msprintf, "msprintf"}
+       {sci_msprintf, "msprintf"},
+       {sci_disp, "disp"}
 };
 /*--------------------------------------------------------------------------*/
 int gw_output_stream(void)
  *
  */
 
-#include "gw_io.h"
+#include "machine.h"
+#include "gw_output_stream.h"
 /*--------------------------------------------------------------------------*/
-int C2F(sci_disp)(char *fname,unsigned long fname_len)
+extern int C2F(intdisp)(); /* fortran subroutine */
+/*--------------------------------------------------------------------------*/
+int sci_disp(char *fname,unsigned long fname_len)
 {
        C2F(intdisp)();
        return 0;
index 0be8df8..21761a8 100644 (file)
@@ -35,4 +35,5 @@
 <PRIMITIVE gatewayId="33" primitiveId="1" primitiveName="print" />
 <PRIMITIVE gatewayId="33" primitiveId="2" primitiveName="mprintf" />
 <PRIMITIVE gatewayId="33" primitiveId="3" primitiveName="msprintf" />
+<PRIMITIVE gatewayId="33" primitiveId="4" primitiveName="disp" />
 </GATEWAY>
\ No newline at end of file
index 83f94bd..546f426 100644 (file)
                                >
                        </File>
                        <File
+                               RelativePath="..\..\sci_gateway\c\sci_disp.c"
+                               >
+                       </File>
+                       <File
                                RelativePath="..\..\sci_gateway\c\sci_mprintf.c"
                                >
                        </File>
index 1a1029f..3865791 100644 (file)
@@ -90,6 +90,7 @@ lib /DEF:&quot;$(InputDir)Output_stream_Import.def&quot; /SUBSYSTEM:WINDOWS /MAC
                <File RelativePath=".\fmt.f"/>
                <File RelativePath=".\fmttyp.f"/>
                <File RelativePath=".\formatnumber.f"/>
+               <File RelativePath="..\..\sci_gateway\fortran\intdisp.f"/>
                <File RelativePath="..\..\sci_gateway\fortran\intprint.f"/>
                <File RelativePath=".\lspdsp.f"/>
                <File RelativePath=".\print.f"/>
index 21ead9e..4eddfb5 100644 (file)
                                >
                        </File>
                        <File
+                               RelativePath="..\..\sci_gateway\fortran\intdisp.c"
+                               >
+                       </File>
+                       <File
                                RelativePath="..\..\sci_gateway\fortran\intprint.c"
                                >
                        </File>
                                >
                        </File>
                        <File
+                               RelativePath="..\..\sci_gateway\fortran\intdisp.f"
+                               >
+                       </File>
+                       <File
                                RelativePath="..\..\sci_gateway\fortran\intprint.f"
                                >
                        </File>
diff --git a/scilab/modules/output_stream/tests/unit_tests/disp.dia.ref b/scilab/modules/output_stream/tests/unit_tests/disp.dia.ref
new file mode 100644 (file)
index 0000000..a040be6
--- /dev/null
@@ -0,0 +1,59 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2007-2008 - INRIA - Allan CORNET <allan.cornet@inria.fr>
+//
+//  This file is distributed under the same license as the Scilab package.
+// =============================================================================
+disp([1 2],3);
+    3.  
+    1.    2.  
+disp('A string');
+ A string   
+disp("høyesterettsjustitiarius","disp test :");
+ disp test :   
+ høyesterettsjustitiarius   
+deff('[]=%t_p(l)','disp(l(3),l(2))');
+disp(tlist('t',1,2));
+    1.  
+    2.  
+text=[ "中文測試"; "азеазеясдвклгхклмвцмзер"; ..
+ "ድቅስድቅስግጅክልውሽችክልዝ"; ..
+"すべての人間は、生まれながらにして自由であり、かつ、尊厳と権利と について平等である。人間は、理性と良心とを授けられており、互いに同 胞の精神をもって行動しなければならない。"; ..
+"人 人 生 而 自 由, 在 尊 严 和 权 利 上 一 律 平 等。 他 们 赋 有 理 性 和 良 心, 并 应 以 兄 弟 关 系 的 精 神 相 对 待。"; ..
+"لد جميع الناس أحرارًا متساوين في الكرامة والحقوق. وقد وهبوا عقلاً وضميرًا وعليهم أن يعامل بعضهم بعضًا بروح الإخاء";..
+"כל בני האדם נולדו בני חורין ושווים בערכם ובזכיותיהם. כולם חוננו בתבונה ובמצפון, לפיכך חובה עליהם לנהג איש ברעהו ברוח של אחוה"
+];
+disp(text);
+!中文測試                                                          !
+!                                                                      !
+!азеазеясдвклгхклмвцмзер                        !
+!                                                                      !
+!ድቅስድቅስግጅክልውሽችክልዝ                      !
+!                                                                      !
+!すべての人間は、生まれながらにして自由であり、ã!
+!     ‹ã¤ã€å°ŠåŽ³ã¨æ¨©åˆ©ã¨ ã«ã¤ã„て平等である。人間ã!
+!     ¯ã€ç†æ€§ã¨è‰¯å¿ƒã¨ã‚’授けられており、互いに同 èƒž!
+!     の精神をもって行動しなければならない。        !
+!                                                                      !
+!人 äºº ç”Ÿ è€Œ è‡ª ç”±, åœ¨ å°Š ä¸¥ å’Œ æƒ åˆ© ä¸Š ä¸€ å¾‹ å¹³ ç­‰ã€!
+!     ‚ ä»– ä»¬ èµ‹ æœ‰ ç† æ€§ å’Œ è‰¯ å¿ƒ, å¹¶ åº” ä»¥ å…„ å¼Ÿ å…³ ç³!
+!     » çš„ ç²¾ ç¥ž ç›¸ å¯¹ å¾…。                                     !
+!                                                                      !
+!لد جميع الناس أحرارًا متساوين في الكرا!
+!     مة والحقوق. وقد وهبوا عقلاً وضميرًا !
+!     ÙˆØ¹Ù„يهم Ø£Ù† ÙŠØ¹Ø§Ù…Ù„ Ø¨Ø¹Ø¶Ù‡Ù… Ø¨Ø¹Ø¶Ù‹Ø§ Ø¨Ø±ÙˆØ­ Ø§Ù„Ø!
+!     ¥Ø®Ø§Ø¡                                                          !
+!                                                                      !
+!כל ×‘× ×™ ×”אדם × ×•×œ×“ו ×‘× ×™ ×—ורין ×•×©×•×•×™× ×‘ער×!
+!     ›× ×•×‘זכיותיהם. ×›×•×œ× ×—וננו ×‘תבונה ×•×‘מ!
+!     צפון, לפיכך חובה עליהם לנהג איש ברעה!
+!     ו ברוח של אחוה                                        !
diff --git a/scilab/modules/output_stream/tests/unit_tests/disp.tst b/scilab/modules/output_stream/tests/unit_tests/disp.tst
new file mode 100644 (file)
index 0000000..d35ac77
--- /dev/null
@@ -0,0 +1,23 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2007-2008 - INRIA - Allan CORNET <allan.cornet@inria.fr>
+//
+//  This file is distributed under the same license as the Scilab package.
+// =============================================================================
+
+disp([1 2],3);
+disp('A string');
+disp("høyesterettsjustitiarius","disp test :");
+deff('[]=%t_p(l)','disp(l(3),l(2))');
+disp(tlist('t',1,2));
+
+
+text=[ "中文測試"; "азеазеясдвклгхклмвцмзер"; ..
+ "ድቅስድቅስግጅክልውሽችክልዝ"; ..
+"すべての人間は、生まれながらにして自由であり、かつ、尊厳と権利と について平等である。人間は、理性と良心とを授けられており、互いに同 胞の精神をもって行動しなければならない。"; ..
+"人 人 生 而 自 由, 在 尊 严 和 权 利 上 一 律 平 等。 他 们 赋 有 理 性 和 良 心, 并 应 以 兄 弟 关 系 的 精 神 相 对 待。"; ..
+"لد جميع الناس أحرارًا متساوين في الكرامة والحقوق. وقد وهبوا عقلاً وضميرًا وعليهم أن يعامل بعضهم بعضًا بروح الإخاء";..
+"כל בני האדם נולדו בני חורין ושווים בערכם ובזכיותיהם. כולם חוננו בתבונה ובמצפון, לפיכך חובה עליהם לנהג איש ברעהו ברוח של אחוה"
+];
+
+disp(text);
\ No newline at end of file