[uim-commit] r2643 - in branches/r5rs: sigscheme uim

yamaken at freedesktop.org yamaken at freedesktop.org
Sun Dec 18 18:06:58 PST 2005


Author: yamaken
Date: 2005-12-18 18:06:54 -0800 (Sun, 18 Dec 2005)
New Revision: 2643

Modified:
   branches/r5rs/sigscheme/error.c
   branches/r5rs/sigscheme/io.c
   branches/r5rs/sigscheme/main.c
   branches/r5rs/sigscheme/operations-siod.c
   branches/r5rs/sigscheme/operations-srfi38.c
   branches/r5rs/sigscheme/print.c
   branches/r5rs/sigscheme/read.c
   branches/r5rs/sigscheme/sigschemeinternal.h
   branches/r5rs/uim/uim-scm.c
Log:
* sigscheme/sigschemeinternal.h
  - (scm_current_input_port, scm_in): Rename scm_current_input_port
    with scm_in
  - (scm_current_output_port, scm_out): Rename scm_current_output_port
    with scm_out
  - (scm_current_error_port, scm_err): Rename scm_current_error_port
    with scm_err
* sigscheme/io.c
  - (scm_current_input_port, scm_in): Rename scm_current_input_port
    with scm_in
  - (scm_current_output_port, scm_out): Rename scm_current_output_port
    with scm_out
  - (scm_current_error_port, scm_err): Rename scm_current_error_port
    with scm_err
* Follow the renaming in all sigscheme/*.[hc]
* uim/uim-scm.c
  - (uim_scm_init): Follow the renaming


Modified: branches/r5rs/sigscheme/error.c
===================================================================
--- branches/r5rs/sigscheme/error.c	2005-12-19 02:04:48 UTC (rev 2642)
+++ branches/r5rs/sigscheme/error.c	2005-12-19 02:06:54 UTC (rev 2643)
@@ -262,12 +262,12 @@
     if (scm_debug_categories() & SCM_DBG_ERRMSG) {
         scm_show_error_header();
         if (ERROBJP(err_obj)) {
-            scm_display_to_port(scm_current_error_port, err_obj);
+            scm_display_to_port(scm_err, err_obj);
         } else {
-            scm_port_puts(scm_current_error_port,
+            scm_port_puts(scm_err,
                           SCM_ERRMSG_UNHANDLED_EXCEPTION);
-            scm_port_puts(scm_current_error_port, ": ");
-            scm_write_to_port(scm_current_error_port, err_obj);
+            scm_port_puts(scm_err, ": ");
+            scm_write_to_port(scm_err, err_obj);
         }
         scm_error_newline();
     }
@@ -355,7 +355,7 @@
 
     if (SYMBOLP(arg) && !UNBOUNDP(arg, env)) {
         scm_error_printf("  - [%s]: ", SCM_SYMBOL_NAME(arg));
-        SCM_WRITESS_TO_PORT(scm_current_error_port, scm_symbol_value(arg, env));
+        SCM_WRITESS_TO_PORT(scm_err, scm_symbol_value(arg, env));
         scm_error_newline();
     }
 
@@ -381,7 +381,7 @@
         env = TRACE_FRAME_ENV(frame);
         obj = TRACE_FRAME_OBJ(frame);
 
-        SCM_WRITESS_TO_PORT(scm_current_error_port, obj);
+        SCM_WRITESS_TO_PORT(scm_err, obj);
         scm_error_newline();
 
 #if SCM_DEBUG_BACKTRACE_VAL

Modified: branches/r5rs/sigscheme/io.c
===================================================================
--- branches/r5rs/sigscheme/io.c	2005-12-19 02:04:48 UTC (rev 2642)
+++ branches/r5rs/sigscheme/io.c	2005-12-19 02:06:54 UTC (rev 2643)
@@ -65,9 +65,9 @@
 /*=======================================
   Variable Declarations
 =======================================*/
-ScmObj scm_current_input_port   = NULL;
-ScmObj scm_current_output_port  = NULL;
-ScmObj scm_current_error_port  = NULL;
+ScmObj scm_in;   /* current-input-port */
+ScmObj scm_out;  /* current-output-port */
+ScmObj scm_err;  /* current error port */
 
 const char *scm_lib_path = NULL;
 
@@ -95,15 +95,15 @@
     scm_sbcport_init();
 #endif
 
-    scm_current_input_port  = scm_make_shared_file_port(stdin, "stdin",
+    scm_in  = scm_make_shared_file_port(stdin, "stdin",
                                                      SCM_PORTFLAG_INPUT);
-    scm_current_output_port = scm_make_shared_file_port(stdout, "stdout",
+    scm_out = scm_make_shared_file_port(stdout, "stdout",
                                                      SCM_PORTFLAG_OUTPUT);
-    scm_current_error_port  = scm_make_shared_file_port(stderr, "stderr",
+    scm_err  = scm_make_shared_file_port(stderr, "stderr",
                                                      SCM_PORTFLAG_OUTPUT);
-    scm_gc_protect(&scm_current_input_port);
-    scm_gc_protect(&scm_current_output_port);
-    scm_gc_protect(&scm_current_error_port);
+    scm_gc_protect(&scm_in);
+    scm_gc_protect(&scm_out);
+    scm_gc_protect(&scm_err);
 }
 
 void
@@ -183,13 +183,13 @@
 void
 scm_error_vprintf(const char *fmt, va_list args)
 {
-    scm_port_vprintf(scm_current_error_port, fmt, args);
+    scm_port_vprintf(scm_err, fmt, args);
 }
 
 void
 scm_error_newline(void)
 {
-    scm_port_newline(scm_current_error_port);
+    scm_port_newline(scm_err);
 }
 
 int
@@ -326,7 +326,7 @@
 {
     DECLARE_FUNCTION("current-input-port", procedure_fixed_0);
 
-    return scm_current_input_port;
+    return scm_in;
 }
 
 ScmObj
@@ -334,7 +334,7 @@
 {
     DECLARE_FUNCTION("current-output-port", procedure_fixed_0);
 
-    return scm_current_output_port;
+    return scm_out;
 }
 
 ScmObj
@@ -346,13 +346,13 @@
     ASSERT_STRINGP(filepath);
     ASSERT_PROCEDUREP(thunk);
 
-    saved_port = scm_current_input_port;
-    scm_current_input_port = scm_p_open_input_file(filepath);
+    saved_port = scm_in;
+    scm_in = scm_p_open_input_file(filepath);
 
     ret = scm_call(thunk, SCM_NULL);
 
-    scm_p_close_input_port(scm_current_input_port);
-    scm_current_input_port = saved_port;
+    scm_p_close_input_port(scm_in);
+    scm_in = saved_port;
 
     return ret;
 }
@@ -366,13 +366,13 @@
     ASSERT_STRINGP(filepath);
     ASSERT_PROCEDUREP(thunk);
 
-    saved_port = scm_current_output_port;
-    scm_current_output_port = scm_p_open_output_file(filepath);
+    saved_port = scm_out;
+    scm_out = scm_p_open_output_file(filepath);
 
     ret = scm_call(thunk, SCM_NULL);
 
-    scm_p_close_output_port(scm_current_output_port);
-    scm_current_output_port = saved_port;
+    scm_p_close_output_port(scm_out);
+    scm_out = saved_port;
 
     return ret;
 }
@@ -458,7 +458,7 @@
     ScmObj port;
     DECLARE_FUNCTION("read", procedure_variadic_0);
 
-    PREPARE_PORT(port, args, scm_current_input_port);
+    PREPARE_PORT(port, args, scm_in);
     return scm_read(port);
 }
 
@@ -469,7 +469,7 @@
     int ch;
     DECLARE_FUNCTION("read-char", procedure_variadic_0);
 
-    PREPARE_PORT(port, args, scm_current_input_port);
+    PREPARE_PORT(port, args, scm_in);
 
     ch = scm_port_get_char(port);
     if (ch == EOF)
@@ -485,7 +485,7 @@
     int ch;
     DECLARE_FUNCTION("peek-char", procedure_variadic_0);
 
-    PREPARE_PORT(port, args, scm_current_input_port);
+    PREPARE_PORT(port, args, scm_in);
 
     ch = scm_port_peek_char(port);
     if (ch == EOF)
@@ -508,7 +508,7 @@
     ScmObj port;
     DECLARE_FUNCTION("char-ready?", procedure_variadic_0);
 
-    PREPARE_PORT(port, args, scm_current_input_port);
+    PREPARE_PORT(port, args, scm_in);
 
     return (scm_port_char_readyp(port))? SCM_TRUE : SCM_FALSE;
 }
@@ -522,7 +522,7 @@
     ScmObj port;
     DECLARE_FUNCTION("write", procedure_variadic_1);
 
-    PREPARE_PORT(port, args, scm_current_output_port);
+    PREPARE_PORT(port, args, scm_out);
     scm_write_to_port(port, obj);
     return SCM_UNDEF;
 }
@@ -533,7 +533,7 @@
     ScmObj port;
     DECLARE_FUNCTION("display", procedure_variadic_1);
 
-    PREPARE_PORT(port, args, scm_current_output_port);
+    PREPARE_PORT(port, args, scm_out);
     scm_display_to_port(port, obj);
     return SCM_UNDEF;
 }
@@ -544,7 +544,7 @@
     ScmObj port;
     DECLARE_FUNCTION("newline", procedure_variadic_0);
 
-    PREPARE_PORT(port, args, scm_current_output_port);
+    PREPARE_PORT(port, args, scm_out);
     scm_port_newline(port);
     return SCM_UNDEF;
 }
@@ -557,7 +557,7 @@
 
     ASSERT_CHARP(obj);
 
-    PREPARE_PORT(port, args, scm_current_output_port);
+    PREPARE_PORT(port, args, scm_out);
     scm_display_to_port(port, obj);
     return SCM_UNDEF;
 }

Modified: branches/r5rs/sigscheme/main.c
===================================================================
--- branches/r5rs/sigscheme/main.c	2005-12-19 02:04:48 UTC (rev 2642)
+++ branches/r5rs/sigscheme/main.c	2005-12-19 02:06:54 UTC (rev 2643)
@@ -111,12 +111,12 @@
 
     for (;;) {
         if (show_promptp())
-            scm_port_puts(scm_current_output_port, PROMPT_STR);
+            scm_port_puts(scm_out, PROMPT_STR);
 
 #if SCM_USE_SRFI34
         /* error-proof read */
         sexp = EVAL(LIST_3(sym_guard, cond_catch,
-                           LIST_2(proc_read, scm_current_input_port)),
+                           LIST_2(proc_read, scm_in)),
                     SCM_INTERACTION_ENV);
         if (EOFP(sexp))
             break;
@@ -138,7 +138,7 @@
         result = EVAL(LIST_3(sym_guard, cond_catch, sexp),
                       SCM_INTERACTION_ENV);
 #else /* SCM_USE_SRFI34 */
-        sexp = scm_read(scm_current_input_port)
+        sexp = scm_read(scm_in)
         if (EOFP(sexp))
             break;
 
@@ -146,8 +146,8 @@
 #endif /* SCM_USE_SRFI34 */
 
         if (!EQ(result, err)) {
-            SCM_WRITESS_TO_PORT(scm_current_output_port, result);
-            scm_port_newline(scm_current_output_port);
+            SCM_WRITESS_TO_PORT(scm_out, result);
+            scm_port_newline(scm_out);
         }
     }
 }

Modified: branches/r5rs/sigscheme/operations-siod.c
===================================================================
--- branches/r5rs/sigscheme/operations-siod.c	2005-12-19 02:04:48 UTC (rev 2642)
+++ branches/r5rs/sigscheme/operations-siod.c	2005-12-19 02:06:54 UTC (rev 2643)
@@ -263,16 +263,16 @@
                                   | scm_predefined_debug_categories());
 
     if (level == 0) {
-        saved_error_port = scm_current_error_port;
-        saved_output_port = scm_current_output_port;
+        saved_error_port = scm_err;
+        saved_output_port = scm_out;
 
-        scm_current_error_port = null_port;
-        scm_current_output_port = null_port;
+        scm_err = null_port;
+        scm_out = null_port;
     } else {
-        if (FALSEP(scm_current_error_port))
-            scm_current_error_port = saved_error_port;
-        if (FALSEP(scm_current_output_port))
-            scm_current_output_port = saved_output_port;
+        if (FALSEP(scm_err))
+            scm_err = saved_error_port;
+        if (FALSEP(scm_out))
+            scm_out = saved_output_port;
     }
 }
 

Modified: branches/r5rs/sigscheme/operations-srfi38.c
===================================================================
--- branches/r5rs/sigscheme/operations-srfi38.c	2005-12-19 02:04:48 UTC (rev 2642)
+++ branches/r5rs/sigscheme/operations-srfi38.c	2005-12-19 02:06:54 UTC (rev 2643)
@@ -76,11 +76,11 @@
 ScmObj
 scm_p_srfi38_write_with_shared_structure(ScmObj obj, ScmObj args)
 {
-    ScmObj port = scm_current_output_port;
+    ScmObj port = scm_out;
     DECLARE_FUNCTION("write-with-shared-structure", procedure_variadic_1);
 
     /* get port */
-    port = scm_current_output_port;
+    port = scm_out;
     if (!NULLP(args) && PORTP(CAR(args)))
         port = CAR(args);
 

Modified: branches/r5rs/sigscheme/print.c
===================================================================
--- branches/r5rs/sigscheme/print.c	2005-12-19 02:04:48 UTC (rev 2642)
+++ branches/r5rs/sigscheme/print.c	2005-12-19 02:06:54 UTC (rev 2643)
@@ -129,7 +129,7 @@
 void
 scm_display(ScmObj obj)
 {
-    scm_display_to_port(scm_current_output_port, obj);
+    scm_display_to_port(scm_out, obj);
 }
 
 void

Modified: branches/r5rs/sigscheme/read.c
===================================================================
--- branches/r5rs/sigscheme/read.c	2005-12-19 02:04:48 UTC (rev 2642)
+++ branches/r5rs/sigscheme/read.c	2005-12-19 02:06:54 UTC (rev 2643)
@@ -147,7 +147,7 @@
     sexp = read_sexpression(port);
 #if SCM_DEBUG
     if ((scm_debug_categories() & SCM_DBG_READ) && !EOFP(sexp)) {
-        scm_write_to_port(scm_current_error_port, sexp);
+        scm_write_to_port(scm_err, sexp);
         scm_error_newline();
     }
 #endif

Modified: branches/r5rs/sigscheme/sigschemeinternal.h
===================================================================
--- branches/r5rs/sigscheme/sigschemeinternal.h	2005-12-19 02:04:48 UTC (rev 2642)
+++ branches/r5rs/sigscheme/sigschemeinternal.h	2005-12-19 02:06:54 UTC (rev 2643)
@@ -62,9 +62,9 @@
 extern ScmObj scm_sym_else, scm_sym_yields;
 
 /* io.c */
-extern ScmObj scm_current_input_port;
-extern ScmObj scm_current_output_port;
-extern ScmObj scm_current_error_port;
+extern ScmObj scm_in;
+extern ScmObj scm_out;
+extern ScmObj scm_err;
 
 /* print.c */
 extern void (*scm_writess_func)(ScmObj port, ScmObj obj);

Modified: branches/r5rs/uim/uim-scm.c
===================================================================
--- branches/r5rs/uim/uim-scm.c	2005-12-19 02:04:48 UTC (rev 2642)
+++ branches/r5rs/uim/uim-scm.c	2005-12-19 02:06:54 UTC (rev 2643)
@@ -49,8 +49,8 @@
 #endif
 
 /* FIXME: violent internal access */
-extern ScmObj scm_current_output_port;
-extern ScmObj scm_current_error_port;
+extern ScmObj scm_out;
+extern ScmObj scm_err;
 
 static void uim_scm_error(const char *msg, uim_lisp errobj);
 
@@ -607,7 +607,7 @@
 
   /* GC safe */
   output_port = scm_make_shared_file_port(uim_output, "uim", SCM_PORTFLAG_OUTPUT);
-  scm_current_output_port = scm_current_error_port = output_port;
+  scm_out = scm_err = output_port;
 
 #ifdef DEBUG_SCM
   /* required by test-im.scm */



More information about the uim-commit mailing list