guile-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] GNU Guile branch, master, updated. release_1-9-14-84-g43


From: Ludovic Courtès
Subject: [Guile-commits] GNU Guile branch, master, updated. release_1-9-14-84-g4325620
Date: Sun, 23 Jan 2011 00:28:15 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Guile".

http://git.savannah.gnu.org/cgit/guile.git/commit/?id=4325620f6d13bb56abed240528863c38d4e5b3f7

The branch, master has been updated
       via  4325620f6d13bb56abed240528863c38d4e5b3f7 (commit)
       via  a917871527571868d2e9465dd41f7678e3101714 (commit)
      from  23aad1505d6ae8d964febda6e7550337aa5a5773 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 4325620f6d13bb56abed240528863c38d4e5b3f7
Author: Ludovic Courtès <address@hidden>
Date:   Sun Jan 23 01:26:07 2011 +0100

    Rewrite `scm_lfwrite_substr' in terms of `scm_display'.
    
    * libguile/ports.c (scm_lfwrite_substr): Rewrite in terms of
      `scm_display'.

commit a917871527571868d2e9465dd41f7678e3101714
Author: Ludovic Courtès <address@hidden>
Date:   Sun Jan 23 01:14:51 2011 +0100

    Remove `scm_lfwrite_str'.
    
    * libguile/ports.c (scm_lfwrite_str): Remove.
    
    * libguile/ports.h (scm_lfwrite_str): Remove declaration.
    
    * libguile/numbers.c (scm_i_print_fraction): Use `scm_display' instead
      of `scm_lfwrite_str'.

-----------------------------------------------------------------------

Summary of changes:
 libguile/numbers.c |    2 +-
 libguile/ports.c   |   57 +++------------------------------------------------
 libguile/ports.h   |    4 +-
 3 files changed, 7 insertions(+), 56 deletions(-)

diff --git a/libguile/numbers.c b/libguile/numbers.c
index 88b225c..9c33d07 100644
--- a/libguile/numbers.c
+++ b/libguile/numbers.c
@@ -2530,7 +2530,7 @@ scm_i_print_fraction (SCM sexp, SCM port, scm_print_state 
*pstate SCM_UNUSED)
 {
   SCM str;
   str = scm_number_to_string (sexp, SCM_UNDEFINED);
-  scm_lfwrite_str (str, port);
+  scm_display (str, port);
   scm_remember_upto_here_1 (str);
   return !0;
 }
diff --git a/libguile/ports.c b/libguile/ports.c
index fa82961..91abcb9 100644
--- a/libguile/ports.c
+++ b/libguile/ports.c
@@ -1251,68 +1251,19 @@ scm_lfwrite (const char *ptr, size_t size, SCM port)
     pt->rw_active = SCM_PORT_WRITE;
 }
 
-/* Write a scheme string STR to PORT from START inclusive to END
-   exclusive.  */
+/* Write STR to PORT from START inclusive to END exclusive.  */
 void
 scm_lfwrite_substr (SCM str, size_t start, size_t end, SCM port)
 {
-  size_t i, size = scm_i_string_length (str);
   scm_t_port *pt = SCM_PTAB_ENTRY (port);
-  scm_t_ptob_descriptor *ptob = &scm_ptobs[SCM_PTOBNUM (port)];
-  scm_t_wchar p;
-  char *buf;
-  size_t len;
-
-  if (pt->rw_active == SCM_PORT_READ)
-    scm_end_input (port);
-
-  if (end == (size_t) (-1))
-    end = size;
-  size = end - start;
-
-  /* Note that making a substring will likely take the
-     stringbuf_write_mutex.  So, one shouldn't use scm_lfwrite_substr
-     if the stringbuf write mutex may still be held elsewhere.  */
-  buf = scm_to_stringn (scm_c_substring (str, start, end), &len,
-                       pt->encoding, pt->ilseq_handler);
-  ptob->write (port, buf, len);
-  free (buf);
-
-  for (i = 0; i < size; i++)
-    {
-      p = scm_i_string_ref (str, i + start);
-      update_port_lf (p, port);
-    }
-
-  if (pt->rw_random)
-    pt->rw_active = SCM_PORT_WRITE;
-}
-
-/* Write a scheme string STR to PORT.  */
-/* FIXME: Get rid of it.  */
-void
-scm_lfwrite_str (SCM str, SCM port)
-{
-  size_t i, size = scm_i_string_length (str);
-  scm_t_port *pt = SCM_PTAB_ENTRY (port);
-  scm_t_ptob_descriptor *ptob = &scm_ptobs[SCM_PTOBNUM (port)];
-  scm_t_wchar p;
-  char *buf;
-  size_t len;
 
   if (pt->rw_active == SCM_PORT_READ)
     scm_end_input (port);
 
-  buf = scm_to_stringn (str, &len,
-                       pt->encoding, pt->ilseq_handler);
-  ptob->write (port, buf, len);
-  free (buf);
+  if (end == (size_t) -1)
+    end = scm_i_string_length (str);
 
-  for (i = 0; i < size; i++)
-    {
-      p = scm_i_string_ref (str, i);
-      update_port_lf (p, port);
-    }
+  scm_display (scm_c_substring (str, start, end), port);
 
   if (pt->rw_random)
     pt->rw_active = SCM_PORT_WRITE;
diff --git a/libguile/ports.h b/libguile/ports.h
index 43cb392..36289ef 100644
--- a/libguile/ports.h
+++ b/libguile/ports.h
@@ -3,7 +3,8 @@
 #ifndef SCM_PORTS_H
 #define SCM_PORTS_H
 
-/* Copyright (C) 1995,1996,1997,1998,1999,2000,2001, 2003, 2004, 2006, 2008, 
2009, 2010 Free Software Foundation, Inc.
+/* Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004,
+ *   2006, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public License
@@ -277,7 +278,6 @@ SCM_API scm_t_wchar scm_getc (SCM port);
 SCM_API size_t scm_c_read (SCM port, void *buffer, size_t size);
 SCM_API void scm_c_write (SCM port, const void *buffer, size_t size);
 SCM_API void scm_lfwrite (const char *ptr, size_t size, SCM port);
-SCM_INTERNAL void scm_lfwrite_str (SCM str, SCM port);
 SCM_INTERNAL void scm_lfwrite_substr (SCM str, size_t start, size_t end,
                                      SCM port);
 SCM_API void scm_flush (SCM port);


hooks/post-receive
-- 
GNU Guile



reply via email to

[Prev in Thread] Current Thread [Next in Thread]