]> git.donarmstrong.com Git - lilypond.git/commitdiff
(gulp-port): rename from read. Don't redefine
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Mon, 6 Jun 2005 19:25:58 +0000 (19:25 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Mon, 6 Jun 2005 19:25:58 +0000 (19:25 +0000)
system primitives.
(gulp-port): using read-string!/partial. We don't want to read an
entire PS file  (GUILE 1.6 limits strings to 16M)

ChangeLog
scm/ps-to-png.scm

index 82ca907f23a4b7ec0d8a397f55eb26da4adc5ff1..661e5e44cc960835fd37173588728e6ba90c1912 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2005-06-06  Han-Wen Nienhuys  <hanwen@xs4all.nl>
 
+       * scm/ps-to-png.scm (gulp-port): rename from read. Don't redefine
+       system primitives.
+       (gulp-port): using read-string!/partial. We don't want to read an
+       entire PS file  (GUILE 1.6 limits strings to 16M) 
+
        * scm/define-grobs.scm (all-grob-descriptions): remove arch-*
        properties. Add font-interface. 
 
index 20c69b11482bc050a60bada301f085c50063a3b5..eab59e54043b1244bac00bb79a355a118e9bb335 100644 (file)
@@ -9,7 +9,7 @@
 (use-modules
  (ice-9 optargs)
  (ice-9 regex)
- (ice-9 rdelim)
+ (ice-9 rw)
  (srfi srfi-1))
 
 ;; gettext wrapper for guile < 1.7.2
 (define (re-sub re sub string)
   (regexp-substitute/global #f re string 'pre sub 'post))
 
-(define (read port)
-  (let ((s (read-delimited "" port)))
-    (if (eof-object? s) "" s)))
+(define (gulp-port port how-much)
+  (let*
+      ((str (make-string how-much)))
+
+    (read-string!/partial str port)
+    str))
 
 (define (dir-listing dir-name)
   (define (dir-helper dir lst)
@@ -48,7 +51,7 @@
  -c quit 2>~S"
                          file-name bbox))
         (status (system cmd))
-        (s (read (open-file bbox "r")))
+        (s (gulp-port (open-file bbox "r") 10240))
         (m (string-match BOUNDING_BOX_RE s)))
     (display m)
     (newline)
@@ -64,7 +67,7 @@
         (rename-page-1? #f)
         (verbose? #f))
    (let* ((base (basename (re-sub "\.e?ps" "" ps-name)))
-         (header (read (open-file ps-name "r")))
+         (header (gulp-port (open-file ps-name "r") 10240))
          (png1 (string-append base ".png"))
          (pngn (string-append base "-page%d.png"))
          (pngn-re (re-sub "%d" "[0-9]*" pngn))