[uim-commit] r3022 - branches/r5rs/sigscheme/src

yamaken at freedesktop.org yamaken at freedesktop.org
Sun Jan 29 13:01:00 PST 2006


Author: yamaken
Date: 2006-01-29 13:00:57 -0800 (Sun, 29 Jan 2006)
New Revision: 3022

Modified:
   branches/r5rs/sigscheme/src/io.c
   branches/r5rs/sigscheme/src/read.c
   branches/r5rs/sigscheme/src/sigscheme.h
   branches/r5rs/sigscheme/src/write.c
Log:
* sigscheme/src/io.c
  - (scm_p_read): Move to read.c
  - (scm_p_write, scm_p_display): Move to write.c
  - (scm_p_write_char): Make independent from write.c
* sigscheme/src/read.c
  - (scm_read):
    * Remove variable initialization
    * Remove ENSURE_PORT(port)
* sigscheme/src/write.c
  - (scm_p_write, scm_p_display): Moved from io.c
* sigscheme/src/sigscheme.h
  - Move prototype sections


Modified: branches/r5rs/sigscheme/src/io.c
===================================================================
--- branches/r5rs/sigscheme/src/io.c	2006-01-29 20:37:42 UTC (rev 3021)
+++ branches/r5rs/sigscheme/src/io.c	2006-01-29 21:00:57 UTC (rev 3022)
@@ -447,16 +447,8 @@
 /*===========================================================================
   R5RS : 6.6 Input and Output : 6.6.2 Input
 ===========================================================================*/
-ScmObj
-scm_p_read(ScmObj args)
-{
-    ScmObj port;
-    DECLARE_FUNCTION("read", procedure_variadic_0);
+/* scm_p_read() is separated into read.c */
 
-    port = scm_prepare_port(args, scm_in);
-    return scm_read(port);
-}
-
 ScmObj
 scm_p_read_char(ScmObj args)
 {
@@ -513,29 +505,9 @@
 /*===========================================================================
   R5RS : 6.6 Input and Output : 6.6.3 Output
 ===========================================================================*/
-ScmObj
-scm_p_write(ScmObj obj, ScmObj args)
-{
-    ScmObj port;
-    DECLARE_FUNCTION("write", procedure_variadic_1);
+/* scm_p_write() and scm_p_display() are separated into write.c */
 
-    port = scm_prepare_port(args, scm_out);
-    scm_write_to_port(port, obj);
-    return SCM_UNDEF;
-}
-
 ScmObj
-scm_p_display(ScmObj obj, ScmObj args)
-{
-    ScmObj port;
-    DECLARE_FUNCTION("display", procedure_variadic_1);
-
-    port = scm_prepare_port(args, scm_out);
-    scm_display_to_port(port, obj);
-    return SCM_UNDEF;
-}
-
-ScmObj
 scm_p_newline(ScmObj args)
 {
     ScmObj port;
@@ -555,7 +527,7 @@
     ENSURE_CHAR(obj);
 
     port = scm_prepare_port(args, scm_out);
-    scm_display_to_port(port, obj);
+    scm_port_put_char(port, SCM_CHAR_VALUE(obj));
     return SCM_UNDEF;
 }
 

Modified: branches/r5rs/sigscheme/src/read.c
===================================================================
--- branches/r5rs/sigscheme/src/read.c	2006-01-29 20:37:42 UTC (rev 3021)
+++ branches/r5rs/sigscheme/src/read.c	2006-01-29 21:00:57 UTC (rev 3022)
@@ -135,11 +135,9 @@
 ScmObj
 scm_read(ScmObj port)
 {
-    ScmObj sexp = SCM_FALSE;
+    ScmObj sexp;
     DECLARE_INTERNAL_FUNCTION("scm_read");
 
-    ENSURE_PORT(port);
-
     sexp = read_sexpression(port);
 #if SCM_DEBUG
     if ((scm_debug_categories() & SCM_DBG_READ) && !EOFP(sexp)) {
@@ -764,3 +762,16 @@
 {
     return SCM_LIST_2(quoter, read_sexpression(port));
 }
+
+/*===========================================================================
+  R5RS : 6.6 Input and Output : 6.6.2 Input
+===========================================================================*/
+ScmObj
+scm_p_read(ScmObj args)
+{
+    ScmObj port;
+    DECLARE_FUNCTION("read", procedure_variadic_0);
+
+    port = scm_prepare_port(args, scm_in);
+    return scm_read(port);
+}

Modified: branches/r5rs/sigscheme/src/sigscheme.h
===================================================================
--- branches/r5rs/sigscheme/src/sigscheme.h	2006-01-29 20:37:42 UTC (rev 3021)
+++ branches/r5rs/sigscheme/src/sigscheme.h	2006-01-29 21:00:57 UTC (rev 3022)
@@ -1347,7 +1347,6 @@
 int scm_port_vprintf(ScmObj port, const char *fmt, va_list args);
 int scm_port_newline(ScmObj port);
 int scm_port_flush(ScmObj port);
-
 ScmObj scm_p_call_with_input_file(ScmObj filepath, ScmObj proc);
 ScmObj scm_p_call_with_output_file(ScmObj filepath, ScmObj proc);
 ScmObj scm_p_input_portp(ScmObj obj);
@@ -1360,14 +1359,10 @@
 ScmObj scm_p_open_output_file(ScmObj filepath);
 ScmObj scm_p_close_input_port(ScmObj port);
 ScmObj scm_p_close_output_port(ScmObj port);
-
-ScmObj scm_p_read(ScmObj args);
 ScmObj scm_p_read_char(ScmObj args);
 ScmObj scm_p_peek_char(ScmObj args);
 ScmObj scm_p_eof_objectp(ScmObj obj);
 ScmObj scm_p_char_readyp(ScmObj args);
-ScmObj scm_p_write(ScmObj obj, ScmObj args);
-ScmObj scm_p_display(ScmObj obj, ScmObj args);
 ScmObj scm_p_newline(ScmObj args);
 ScmObj scm_p_write_char(ScmObj obj, ScmObj args);
 
@@ -1377,7 +1372,18 @@
 /* read.c */
 ScmObj scm_read(ScmObj port);
 ScmObj scm_read_char(ScmObj port);
+ScmObj scm_p_read(ScmObj args);
 
+/* write.c */
+void scm_display(ScmObj obj);
+void scm_write_to_port(ScmObj port, ScmObj obj);
+void scm_display_to_port(ScmObj port, ScmObj obj);
+#if SCM_USE_SRFI38
+void scm_write_to_port_with_shared_structure(ScmObj port, ScmObj obj);
+#endif
+ScmObj scm_p_write(ScmObj obj, ScmObj args);
+ScmObj scm_p_display(ScmObj obj, ScmObj args);
+
 /* error.c */
 int  scm_debug_categories(void);
 void scm_set_debug_categories(int categories);
@@ -1398,15 +1404,7 @@
 ScmObj scm_p_inspect_error(ScmObj err_obj);
 ScmObj scm_p_backtrace(void);
 
-/* write.c */
-void scm_display(ScmObj obj);
-void scm_write_to_port(ScmObj port, ScmObj obj);
-void scm_display_to_port(ScmObj port, ScmObj obj);
-#if SCM_USE_SRFI38
-void scm_write_to_port_with_shared_structure(ScmObj port, ScmObj obj);
-#endif
 
-
 /*===========================================================================
    SigScheme : Optional Funtions
 ===========================================================================*/

Modified: branches/r5rs/sigscheme/src/write.c
===================================================================
--- branches/r5rs/sigscheme/src/write.c	2006-01-29 20:37:42 UTC (rev 3021)
+++ branches/r5rs/sigscheme/src/write.c	2006-01-29 21:00:57 UTC (rev 3022)
@@ -685,3 +685,28 @@
     free(ctx.seen.ents);
 }
 #endif /* SCM_USE_SRFI38 */
+
+/*===========================================================================
+  R5RS : 6.6 Input and Output : 6.6.3 Output
+===========================================================================*/
+ScmObj
+scm_p_write(ScmObj obj, ScmObj args)
+{
+    ScmObj port;
+    DECLARE_FUNCTION("write", procedure_variadic_1);
+
+    port = scm_prepare_port(args, scm_out);
+    scm_write_to_port(port, obj);
+    return SCM_UNDEF;
+}
+
+ScmObj
+scm_p_display(ScmObj obj, ScmObj args)
+{
+    ScmObj port;
+    DECLARE_FUNCTION("display", procedure_variadic_1);
+
+    port = scm_prepare_port(args, scm_out);
+    scm_display_to_port(port, obj);
+    return SCM_UNDEF;
+}



More information about the uim-commit mailing list