[uim-commit] r1659 - branches/r5rs/sigscheme

yamaken at freedesktop.org yamaken at freedesktop.org
Wed Sep 28 06:51:35 PDT 2005


Author: yamaken
Date: 2005-09-28 06:51:30 -0700 (Wed, 28 Sep 2005)
New Revision: 1659

Modified:
   branches/r5rs/sigscheme/debug.c
   branches/r5rs/sigscheme/error.c
   branches/r5rs/sigscheme/io.c
   branches/r5rs/sigscheme/operations-siod.c
   branches/r5rs/sigscheme/sigscheme.c
   branches/r5rs/sigscheme/sigschemeinternal.h
Log:
* sigscheme/debug.c
  - (SigScm_WriteToPort, SigScm_DisplayToPort):
    * Do nothing if the port is NULL
    * Replace SIOD-compatible printing suppression with above NULL
      handling
* sigscheme/operations-siod.c
  - (SigScm_SetVerboseLevel): Add printing suppression handlings for
    verbose level 0
* sigscheme/sigschemeinternal.h
  - (scm_std_error_port, scm_current_error_port, scm_std_input_port,
    scm_std_output_port): New variable decl
* sigscheme/io.c
  - (scm_std_input_port, scm_std_output_port): New variable
* sigscheme/error.c
  - (scm_std_error_port): New variable
* sigscheme/sigscheme.c
  - (SigScm_Initialize_internal): Add initialization for scm_std_*_port


Modified: branches/r5rs/sigscheme/debug.c
===================================================================
--- branches/r5rs/sigscheme/debug.c	2005-09-28 13:26:47 UTC (rev 1658)
+++ branches/r5rs/sigscheme/debug.c	2005-09-28 13:51:30 UTC (rev 1659)
@@ -179,10 +179,8 @@
 {
     FILE *f = NULL;
 
-#if SCM_COMPAT_SIOD
-    if (SigScm_GetVerboseLevel() == 0)
+    if (!port)
         return;
-#endif
 
     if (SCM_PORTINFO_PORTTYPE(port) == PORT_FILE) {
         f = SCM_PORTINFO_FILE(port);
@@ -200,10 +198,8 @@
 {
     FILE *f = NULL;
 
-#if SCM_COMPAT_SIOD
-    if (SigScm_GetVerboseLevel() == 0)
+    if (!port)
         return;
-#endif
 
     if (SCM_PORTINFO_PORTTYPE(port) == PORT_FILE) {
         f = SCM_PORTINFO_FILE(port);

Modified: branches/r5rs/sigscheme/error.c
===================================================================
--- branches/r5rs/sigscheme/error.c	2005-09-28 13:26:47 UTC (rev 1658)
+++ branches/r5rs/sigscheme/error.c	2005-09-28 13:51:30 UTC (rev 1659)
@@ -58,6 +58,7 @@
 /*=======================================
   Variable Declarations
 =======================================*/
+ScmObj scm_std_error_port  = NULL;
 ScmObj scm_current_error_port  = NULL;
 
 /*=======================================

Modified: branches/r5rs/sigscheme/io.c
===================================================================
--- branches/r5rs/sigscheme/io.c	2005-09-28 13:26:47 UTC (rev 1658)
+++ branches/r5rs/sigscheme/io.c	2005-09-28 13:51:30 UTC (rev 1659)
@@ -53,6 +53,8 @@
 /*=======================================
   Variable Declarations
 =======================================*/
+ScmObj scm_std_input_port   = NULL;
+ScmObj scm_std_output_port  = NULL;
 ScmObj scm_current_input_port   = NULL;
 ScmObj scm_current_output_port  = NULL;
 

Modified: branches/r5rs/sigscheme/operations-siod.c
===================================================================
--- branches/r5rs/sigscheme/operations-siod.c	2005-09-28 13:26:47 UTC (rev 1658)
+++ branches/r5rs/sigscheme/operations-siod.c	2005-09-28 13:51:30 UTC (rev 1659)
@@ -195,4 +195,14 @@
     if (level >= 2)
         SigScm_SetDebugCategories(SigScm_DebugCategories()
                                   | SigScm_PredefinedDebugCategories());
+
+    if (level == 0) {
+        scm_current_error_port = NULL;
+        scm_current_output_port = NULL;
+    } else {
+        if (!scm_current_error_port)
+            scm_current_error_port = scm_std_error_port;
+        if (!scm_current_output_port)
+            scm_current_output_port = scm_std_output_port;
+    }
 }

Modified: branches/r5rs/sigscheme/sigscheme.c
===================================================================
--- branches/r5rs/sigscheme/sigscheme.c	2005-09-28 13:26:47 UTC (rev 1658)
+++ branches/r5rs/sigscheme/sigscheme.c	2005-09-28 13:51:30 UTC (rev 1659)
@@ -329,9 +329,15 @@
     /*=======================================================================
       Current Input & Output Initialization
     =======================================================================*/
-    scm_current_input_port  = Scm_NewFilePort(stdin,  "stdin",  PORT_INPUT);
-    scm_current_output_port = Scm_NewFilePort(stdout, "stdout", PORT_OUTPUT);
-    scm_current_error_port  = Scm_NewFilePort(stderr, "stderr", PORT_OUTPUT);
+    scm_std_input_port  = Scm_NewFilePort(stdin,  "stdin",  PORT_INPUT);
+    scm_std_output_port = Scm_NewFilePort(stdout, "stdout", PORT_OUTPUT);
+    scm_std_error_port  = Scm_NewFilePort(stderr, "stderr", PORT_OUTPUT);
+    scm_current_input_port  = scm_std_input_port;
+    scm_current_output_port = scm_std_output_port;
+    scm_current_error_port  = scm_std_error_port;
+    SigScm_GC_Protect(&scm_std_input_port);
+    SigScm_GC_Protect(&scm_std_output_port);
+    SigScm_GC_Protect(&scm_std_error_port);
     SigScm_GC_Protect(&scm_current_input_port);
     SigScm_GC_Protect(&scm_current_output_port);
     SigScm_GC_Protect(&scm_current_error_port);

Modified: branches/r5rs/sigscheme/sigschemeinternal.h
===================================================================
--- branches/r5rs/sigscheme/sigschemeinternal.h	2005-09-28 13:26:47 UTC (rev 1658)
+++ branches/r5rs/sigscheme/sigschemeinternal.h	2005-09-28 13:51:30 UTC (rev 1659)
@@ -62,15 +62,18 @@
 extern ScmObj scm_return_value;
 #endif
 
-/* error.c*/
-extern ScmObj scm_current_error_port;
-
 /* eval.c */
 extern ScmObj scm_continuation_thrown_obj;
 extern ScmObj scm_letrec_env;
 extern struct trace_frame *scm_trace_root;
 
+/* error.c*/
+extern ScmObj scm_std_error_port;
+extern ScmObj scm_current_error_port;
+
 /* io.c */
+extern ScmObj scm_std_input_port;
+extern ScmObj scm_std_output_port;
 extern ScmObj scm_current_input_port;
 extern ScmObj scm_current_output_port;
 extern ScmObj SigScm_features;



More information about the uim-commit mailing list