mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-13 07:10:20 +02:00
* COPYING, boot-9.scm, debug.scm, emacs.scm, expect.scm, gtcl.scm,
gwish.scm, hcons.scm, lineio.scm, mapping.scm, nonblocking.scm, oldprint.scm, poe.scm, r4rs.scm, source.scm, tags.scm, test.scm, threads.scm: New address for FSF.
This commit is contained in:
parent
873b9044b5
commit
1532804164
18 changed files with 39 additions and 264 deletions
|
@ -1,8 +1,8 @@
|
||||||
GNU GENERAL PUBLIC LICENSE
|
GNU GENERAL PUBLIC LICENSE
|
||||||
Version 2, June 1991
|
Version 2, June 1991
|
||||||
|
|
||||||
Copyright (C) 1989, 1991, 1992, 1993 Free Software Foundation, Inc.
|
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||||
675 Mass Ave, Cambridge, MA 02139, USA
|
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
Everyone is permitted to copy and distribute verbatim copies
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
of this license document, but changing it is not allowed.
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
|
@ -279,7 +279,7 @@ POSSIBILITY OF SUCH DAMAGES.
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
Appendix: How to Apply These Terms to Your New Programs
|
How to Apply These Terms to Your New Programs
|
||||||
|
|
||||||
If you develop a new program, and you want it to be of the greatest
|
If you develop a new program, and you want it to be of the greatest
|
||||||
possible use to the public, the best way to achieve this is to make it
|
possible use to the public, the best way to achieve this is to make it
|
||||||
|
@ -305,7 +305,8 @@ the "copyright" line and a pointer to where the full notice is found.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program; if not, write to the Free Software
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
|
|
||||||
Also add information on how to contact you by electronic and paper mail.
|
Also add information on how to contact you by electronic and paper mail.
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,8 @@
|
||||||
;;;;
|
;;;;
|
||||||
;;;; You should have received a copy of the GNU General Public License
|
;;;; You should have received a copy of the GNU General Public License
|
||||||
;;;; along with this software; see the file COPYING. If not, write to
|
;;;; along with this software; see the file COPYING. If not, write to
|
||||||
;;;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
;;;; the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||||
|
;;;; Boston, MA 02111-1307 USA
|
||||||
;;;;
|
;;;;
|
||||||
|
|
||||||
|
|
||||||
|
@ -3178,7 +3179,8 @@
|
||||||
;;;;
|
;;;;
|
||||||
;;;; You should have received a copy of the GNU General Public License
|
;;;; You should have received a copy of the GNU General Public License
|
||||||
;;;; along with this software; see the file COPYING. If not, write to
|
;;;; along with this software; see the file COPYING. If not, write to
|
||||||
;;;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
;;;; the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||||
|
;;;; Boston, MA 02111-1307 USA
|
||||||
;;;;
|
;;;;
|
||||||
|
|
||||||
;;;;
|
;;;;
|
||||||
|
@ -3318,7 +3320,8 @@
|
||||||
;;;;
|
;;;;
|
||||||
;;;; You should have received a copy of the GNU General Public License
|
;;;; You should have received a copy of the GNU General Public License
|
||||||
;;;; along with this software; see the file COPYING. If not, write to
|
;;;; along with this software; see the file COPYING. If not, write to
|
||||||
;;;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
;;;; the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||||
|
;;;; Boston, MA 02111-1307 USA
|
||||||
;;;;
|
;;;;
|
||||||
|
|
||||||
;;;;
|
;;;;
|
||||||
|
|
|
@ -12,7 +12,8 @@
|
||||||
;;;;
|
;;;;
|
||||||
;;;; You should have received a copy of the GNU General Public License
|
;;;; You should have received a copy of the GNU General Public License
|
||||||
;;;; along with this software; see the file COPYING. If not, write to
|
;;;; along with this software; see the file COPYING. If not, write to
|
||||||
;;;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
;;;; the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||||
|
;;;; Boston, MA 02111-1307 USA
|
||||||
;;;;
|
;;;;
|
||||||
;;;; The author can be reached at djurfeldt@nada.kth.se
|
;;;; The author can be reached at djurfeldt@nada.kth.se
|
||||||
;;;; Mikael Djurfeldt, SANS/NADA KTH, 10044 STOCKHOLM, SWEDEN
|
;;;; Mikael Djurfeldt, SANS/NADA KTH, 10044 STOCKHOLM, SWEDEN
|
||||||
|
|
|
@ -12,7 +12,8 @@
|
||||||
;;;;
|
;;;;
|
||||||
;;;; You should have received a copy of the GNU General Public License
|
;;;; You should have received a copy of the GNU General Public License
|
||||||
;;;; along with this software; see the file COPYING. If not, write to
|
;;;; along with this software; see the file COPYING. If not, write to
|
||||||
;;;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
;;;; the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||||
|
;;;; Boston, MA 02111-1307 USA
|
||||||
;;;;
|
;;;;
|
||||||
;;;; The author can be reached at djurfeldt@nada.kth.se
|
;;;; The author can be reached at djurfeldt@nada.kth.se
|
||||||
;;;; Mikael Djurfeldt, SANS/NADA KTH, 10044 STOCKHOLM, SWEDEN
|
;;;; Mikael Djurfeldt, SANS/NADA KTH, 10044 STOCKHOLM, SWEDEN
|
||||||
|
|
|
@ -14,7 +14,8 @@
|
||||||
;;;;
|
;;;;
|
||||||
;;;; You should have received a copy of the GNU General Public License
|
;;;; You should have received a copy of the GNU General Public License
|
||||||
;;;; along with this software; see the file COPYING. If not, write to
|
;;;; along with this software; see the file COPYING. If not, write to
|
||||||
;;;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
;;;; the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||||
|
;;;; Boston, MA 02111-1307 USA
|
||||||
;;;;
|
;;;;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,8 @@
|
||||||
;;;;
|
;;;;
|
||||||
;;;; You should have received a copy of the GNU General Public License
|
;;;; You should have received a copy of the GNU General Public License
|
||||||
;;;; along with this software; see the file COPYING. If not, write to
|
;;;; along with this software; see the file COPYING. If not, write to
|
||||||
;;;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
;;;; the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||||
|
;;;; Boston, MA 02111-1307 USA
|
||||||
;;;;
|
;;;;
|
||||||
;;;; The author can be reached at djurfeldt@nada.kth.se
|
;;;; The author can be reached at djurfeldt@nada.kth.se
|
||||||
;;;; Mikael Djurfeldt, SANS/NADA KTH, 10044 STOCKHOLM, SWEDEN
|
;;;; Mikael Djurfeldt, SANS/NADA KTH, 10044 STOCKHOLM, SWEDEN
|
||||||
|
|
|
@ -12,7 +12,8 @@
|
||||||
;;;;
|
;;;;
|
||||||
;;;; You should have received a copy of the GNU General Public License
|
;;;; You should have received a copy of the GNU General Public License
|
||||||
;;;; along with this software; see the file COPYING. If not, write to
|
;;;; along with this software; see the file COPYING. If not, write to
|
||||||
;;;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
;;;; the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||||
|
;;;; Boston, MA 02111-1307 USA
|
||||||
;;;;
|
;;;;
|
||||||
;;;; The author can be reached at djurfeldt@nada.kth.se
|
;;;; The author can be reached at djurfeldt@nada.kth.se
|
||||||
;;;; Mikael Djurfeldt, SANS/NADA KTH, 10044 STOCKHOLM, SWEDEN
|
;;;; Mikael Djurfeldt, SANS/NADA KTH, 10044 STOCKHOLM, SWEDEN
|
||||||
|
|
|
@ -14,7 +14,8 @@
|
||||||
;;;;
|
;;;;
|
||||||
;;;; You should have received a copy of the GNU General Public License
|
;;;; You should have received a copy of the GNU General Public License
|
||||||
;;;; along with this software; see the file COPYING. If not, write to
|
;;;; along with this software; see the file COPYING. If not, write to
|
||||||
;;;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
;;;; the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||||
|
;;;; Boston, MA 02111-1307 USA
|
||||||
;;;;
|
;;;;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,8 @@
|
||||||
;;;;
|
;;;;
|
||||||
;;;; You should have received a copy of the GNU General Public License
|
;;;; You should have received a copy of the GNU General Public License
|
||||||
;;;; along with this software; see the file COPYING. If not, write to
|
;;;; along with this software; see the file COPYING. If not, write to
|
||||||
;;;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
;;;; the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||||
|
;;;; Boston, MA 02111-1307 USA
|
||||||
;;;;
|
;;;;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,8 @@
|
||||||
;;;;
|
;;;;
|
||||||
;;;; You should have received a copy of the GNU General Public License
|
;;;; You should have received a copy of the GNU General Public License
|
||||||
;;;; along with this software; see the file COPYING. If not, write to
|
;;;; along with this software; see the file COPYING. If not, write to
|
||||||
;;;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
;;;; the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||||
|
;;;; Boston, MA 02111-1307 USA
|
||||||
;;;;
|
;;;;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,82 +0,0 @@
|
||||||
;;;; Copyright (C) 1996 Mikael Djurfeldt
|
|
||||||
;;;;
|
|
||||||
;;;; This program is free software; you can redistribute it and/or modify
|
|
||||||
;;;; it under the terms of the GNU General Public License as published by
|
|
||||||
;;;; the Free Software Foundation; either version 2, or (at your option)
|
|
||||||
;;;; any later version.
|
|
||||||
;;;;
|
|
||||||
;;;; This program is distributed in the hope that it will be useful,
|
|
||||||
;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
;;;; GNU General Public License for more details.
|
|
||||||
;;;;
|
|
||||||
;;;; You should have received a copy of the GNU General Public License
|
|
||||||
;;;; along with this software; see the file COPYING. If not, write to
|
|
||||||
;;;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
||||||
;;;;
|
|
||||||
;;;; The author can be reached at djurfeldt@nada.kth.se
|
|
||||||
;;;; Mikael Djurfeldt, SANS/NADA KTH, 10044 STOCKHOLM, SWEDEN
|
|
||||||
;;;;
|
|
||||||
|
|
||||||
|
|
||||||
;;; *******************************
|
|
||||||
;;; * Experimental hack *
|
|
||||||
;;; * Shouldn't go into snapshots *
|
|
||||||
;;; * Don't distribute! *
|
|
||||||
;;; *******************************
|
|
||||||
|
|
||||||
;;; {Non-blocking ports}
|
|
||||||
;;;
|
|
||||||
|
|
||||||
(define-module (ice-9 nonblocking)
|
|
||||||
:use-module (ice-9 threads))
|
|
||||||
|
|
||||||
(define mu (make-mutex))
|
|
||||||
(define-public repl-input-port-condvar (make-condition-variable))
|
|
||||||
|
|
||||||
(define non-blocking-input #f)
|
|
||||||
|
|
||||||
(define-public (make-non-blocking-port wait-port read-port)
|
|
||||||
(letrec ((read-char-fn (lambda args
|
|
||||||
(if (char-ready? wait-port)
|
|
||||||
(read-char read-port)
|
|
||||||
(begin
|
|
||||||
(wait-condition-variable repl-input-port-condvar
|
|
||||||
mu)
|
|
||||||
(unlock-mutex mu)
|
|
||||||
(read-char-fn))))))
|
|
||||||
(make-soft-port
|
|
||||||
(vector #f #f #f
|
|
||||||
read-char-fn
|
|
||||||
(lambda () (close-port orig-port)))
|
|
||||||
"r")))
|
|
||||||
|
|
||||||
(define-public repl-input-port (current-input-port))
|
|
||||||
(define-public basic-repl-input-port repl-input-port)
|
|
||||||
|
|
||||||
(define-public handle-input-events
|
|
||||||
(lambda ()
|
|
||||||
(if (single-active-thread?)
|
|
||||||
(select (list basic-repl-input-port) '() '()))
|
|
||||||
(if (char-ready? basic-repl-input-port)
|
|
||||||
(signal-condition-variable repl-input-port-condvar)
|
|
||||||
(yield))))
|
|
||||||
|
|
||||||
(define (kick)
|
|
||||||
(call-with-new-thread
|
|
||||||
(lambda ()
|
|
||||||
(error-catching-loop
|
|
||||||
(lambda ()
|
|
||||||
(let loop ()
|
|
||||||
(handle-input-events)
|
|
||||||
(loop)))))
|
|
||||||
(lambda args args)))
|
|
||||||
|
|
||||||
(define-public (activate-non-blocking-input)
|
|
||||||
(if (not non-blocking-input)
|
|
||||||
(begin
|
|
||||||
(set! repl-input-port (make-non-blocking-port basic-repl-input-port
|
|
||||||
(current-input-port)))
|
|
||||||
(set-current-input-port repl-input-port)
|
|
||||||
(kick)
|
|
||||||
(set! non-blocking-input #t))))
|
|
|
@ -12,7 +12,8 @@
|
||||||
;;;;
|
;;;;
|
||||||
;;;; You should have received a copy of the GNU General Public License
|
;;;; You should have received a copy of the GNU General Public License
|
||||||
;;;; along with this software; see the file COPYING. If not, write to
|
;;;; along with this software; see the file COPYING. If not, write to
|
||||||
;;;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
;;;; the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||||
|
;;;; Boston, MA 02111-1307 USA
|
||||||
;;;;
|
;;;;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,8 @@
|
||||||
;;;;
|
;;;;
|
||||||
;;;; You should have received a copy of the GNU General Public License
|
;;;; You should have received a copy of the GNU General Public License
|
||||||
;;;; along with this software; see the file COPYING. If not, write to
|
;;;; along with this software; see the file COPYING. If not, write to
|
||||||
;;;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
;;;; the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||||
|
;;;; Boston, MA 02111-1307 USA
|
||||||
;;;;
|
;;;;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,8 @@
|
||||||
;;;;
|
;;;;
|
||||||
;;;; You should have received a copy of the GNU General Public License
|
;;;; You should have received a copy of the GNU General Public License
|
||||||
;;;; along with this software; see the file COPYING. If not, write to
|
;;;; along with this software; see the file COPYING. If not, write to
|
||||||
;;;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
;;;; the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||||
|
;;;; Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
|
|
||||||
;;;; apply and call-with-current-continuation
|
;;;; apply and call-with-current-continuation
|
||||||
|
|
161
ice-9/source.scm
161
ice-9/source.scm
|
@ -1,161 +0,0 @@
|
||||||
;;;; source.scm --- finding lines of source code for the debugger to display
|
|
||||||
;;;; Jim Blandy <jimb@cyclic.com> --- February 1997
|
|
||||||
;;;;
|
|
||||||
;;;; Copyright (C) 1997 Free Software Foundation, Inc.
|
|
||||||
;;;;
|
|
||||||
;;;; This program is free software; you can redistribute it and/or modify
|
|
||||||
;;;; it under the terms of the GNU General Public License as published by
|
|
||||||
;;;; the Free Software Foundation; either version 2, or (at your option)
|
|
||||||
;;;; any later version.
|
|
||||||
;;;;
|
|
||||||
;;;; This program is distributed in the hope that it will be useful,
|
|
||||||
;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
;;;; GNU General Public License for more details.
|
|
||||||
;;;;
|
|
||||||
;;;; You should have received a copy of the GNU General Public License
|
|
||||||
;;;; along with this software; see the file COPYING. If not, write to
|
|
||||||
;;;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
||||||
|
|
||||||
;;; This module retrieves selected lines from files of source code.
|
|
||||||
;;; It's meant for use by source-level debuggers, to display regions
|
|
||||||
;;; of code to the user.
|
|
||||||
;;;
|
|
||||||
|
|
||||||
;;; We don't keep the text in memory. However, we do cache the
|
|
||||||
;;; starting positions of each line in the file, so once the file has
|
|
||||||
;;; been scanned, we can extract any line we want pretty quickly. We
|
|
||||||
;;; also only scan as far as we need, i.e., up to the latest line
|
|
||||||
;;; we've been asked for. This is fast enough for interactive use,
|
|
||||||
;;; but doesn't take up much memory.
|
|
||||||
|
|
||||||
;(define-module '(ice-9 source))
|
|
||||||
|
|
||||||
|
|
||||||
;;;; public interface
|
|
||||||
|
|
||||||
;;; (get-source-line FILE LINE)
|
|
||||||
;;; Return the text of the LINE'th line from the file FILE, as a
|
|
||||||
;;; string.
|
|
||||||
(define-public (get-source-line file line)
|
|
||||||
...)
|
|
||||||
|
|
||||||
;;; (check-source-cache FILE)
|
|
||||||
;;; The source access routines in this module cache some information
|
|
||||||
;;; about the contents of the files they examine. If we have cached
|
|
||||||
;;; any information about FILE, check its modification time, and forget
|
|
||||||
;;; our cached information if it is out of date.
|
|
||||||
;;;
|
|
||||||
;;; Try to call this function periodically before retrieving lines
|
|
||||||
;;; from FILE; however, it does perform a file system access, so don't
|
|
||||||
;;; call it too often.
|
|
||||||
|
|
||||||
|
|
||||||
;;;; trivia
|
|
||||||
|
|
||||||
(define (throw-out-of-range op index)
|
|
||||||
(throw 'out-of-range op "Argument out of range: %S" (list index) #f))
|
|
||||||
|
|
||||||
|
|
||||||
;;;; stretchy vectors
|
|
||||||
|
|
||||||
;;; A stretchy vector is one that you can append new entries onto
|
|
||||||
;;; efficiently.
|
|
||||||
|
|
||||||
;;; (make-svect) => a new, zero-length stretchy vector
|
|
||||||
(define (make-svect)
|
|
||||||
(cons 0 (make-vector 20 '-)))
|
|
||||||
|
|
||||||
;;; (svect-ref SVECT K) => the K'th element of SVECT
|
|
||||||
(define (svect-ref svect k)
|
|
||||||
(vector-ref (cdr svect) k))
|
|
||||||
|
|
||||||
;;; (svect-add! SVECT ELT) => append ELT to the end of SVECT
|
|
||||||
(define (svect-add! svect elt)
|
|
||||||
|
|
||||||
;; If we don't have room in the current vector, create a new, larger one.
|
|
||||||
(if (>= (car svect) (vector-length (cdr svect)))
|
|
||||||
(let* ((old-vect (cdr svect))
|
|
||||||
(new-vect (make-vector (* 2 (vector-length old-vect)) '-)))
|
|
||||||
(vector-move-left! old-vect 0 (vector-length old-vect)
|
|
||||||
new-vect 0)
|
|
||||||
(set-cdr! svect new-vect)))
|
|
||||||
|
|
||||||
(vector-set! (cdr svect) (car svect) elt)
|
|
||||||
(set-car! svect (+ 1 (car svect))))
|
|
||||||
|
|
||||||
;;; (svect-length SVECT) => the length of SVECT
|
|
||||||
(define svect-length car)
|
|
||||||
|
|
||||||
|
|
||||||
;;;; source files
|
|
||||||
|
|
||||||
;;; We keep a limited number of source files open at any given time.
|
|
||||||
;;; A source file structure looks like:
|
|
||||||
;;;
|
|
||||||
;;; (PORT LINESTARTS)
|
|
||||||
;;;
|
|
||||||
;;; PORT is a seekable input port looking at a text file.
|
|
||||||
;;; LINESTARTS is a stretchy vector, whose Ith element is the seek
|
|
||||||
;;; position of the start of line I (assuming lines are numbered
|
|
||||||
;;; starting with zero). The file may have more lines than this
|
|
||||||
;;; array records; this occurs when we haven't completely scanned
|
|
||||||
;;; the file.
|
|
||||||
(define (make-source file)
|
|
||||||
(let ((port (open-input-file file)))
|
|
||||||
(let ((linestarts (make-svect)))
|
|
||||||
(svect-add! linestarts 0) ; We know where the first line starts.
|
|
||||||
(list port linestarts))))
|
|
||||||
|
|
||||||
;;; Return the text of the LINE'th line of SOURCE. Return the EOF
|
|
||||||
;;; object if SOURCE doesn't have that many lines.
|
|
||||||
(define (get-line source line)
|
|
||||||
(let* ((port (car source))
|
|
||||||
(linestarts (cadr source))
|
|
||||||
(known (svect-length linestarts)))
|
|
||||||
|
|
||||||
;; Starting at the last line whose position is known, scan SOURCE for
|
|
||||||
;; new line positions, until we've found the start of the LINE'th
|
|
||||||
;; line. Assume that LINE is not one whose position we already know.
|
|
||||||
;; Record all line positions in SOURCE. Return the text of
|
|
||||||
;; the LINE'th line (without a newline), or the EOF object if the
|
|
||||||
;; file doesn't have that many lines.
|
|
||||||
(define (scan line)
|
|
||||||
(fseek port (svect-ref linestarts (- known 1)) SEEK_SET)
|
|
||||||
(let loop ((known known))
|
|
||||||
(let ((text (read-line port)))
|
|
||||||
(if (eof-object? text) text
|
|
||||||
(begin
|
|
||||||
(svect-add! linestarts (ftell port))
|
|
||||||
(if (>= line known) (loop (+ known 1))
|
|
||||||
text))))))
|
|
||||||
|
|
||||||
;; Return the text of the line that starts at POS.
|
|
||||||
(define (get pos)
|
|
||||||
(fseek port pos SEEK_SET)
|
|
||||||
(read-line port))
|
|
||||||
|
|
||||||
(if (< line known)
|
|
||||||
(get (svect-ref linestarts line))
|
|
||||||
(scan line))))
|
|
||||||
|
|
||||||
|
|
||||||
;;;; cache of files
|
|
||||||
|
|
||||||
;;; The cache is an alist mapping filenames onto source objects. We
|
|
||||||
;;; put a fixed limit on the number of files it contains; new files replace
|
|
||||||
;;; the least recently used file.
|
|
||||||
|
|
||||||
(define (cache-add! cache max file source)
|
|
||||||
(let* ((cache (cons (cons file source) cache))
|
|
||||||
(
|
|
||||||
(set-cdr!
|
|
||||||
|
|
||||||
(define (cache-ref file)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
(define the-file-cache '())
|
|
||||||
(define file-cache-max 10)
|
|
||||||
|
|
|
@ -14,7 +14,8 @@
|
||||||
;;;;
|
;;;;
|
||||||
;;;; You should have received a copy of the GNU General Public License
|
;;;; You should have received a copy of the GNU General Public License
|
||||||
;;;; along with this software; see the file COPYING. If not, write to
|
;;;; along with this software; see the file COPYING. If not, write to
|
||||||
;;;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
;;;; the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||||
|
;;;; Boston, MA 02111-1307 USA
|
||||||
;;;;
|
;;;;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,8 @@
|
||||||
;;
|
;;
|
||||||
;; You should have received a copy of the GNU General Public License
|
;; You should have received a copy of the GNU General Public License
|
||||||
;; along with this software; see the file COPYING. If not, write to
|
;; along with this software; see the file COPYING. If not, write to
|
||||||
;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
;; the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||||
|
;; Boston, MA 02111-1307 USA
|
||||||
;;
|
;;
|
||||||
;; As a special exception, the Free Software Foundation gives permission
|
;; As a special exception, the Free Software Foundation gives permission
|
||||||
;; for additional uses of the text contained in its release of GUILE.
|
;; for additional uses of the text contained in its release of GUILE.
|
||||||
|
|
|
@ -12,7 +12,8 @@
|
||||||
;;;;
|
;;;;
|
||||||
;;;; You should have received a copy of the GNU General Public License
|
;;;; You should have received a copy of the GNU General Public License
|
||||||
;;;; along with this software; see the file COPYING. If not, write to
|
;;;; along with this software; see the file COPYING. If not, write to
|
||||||
;;;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
;;;; the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||||
|
;;;; Boston, MA 02111-1307 USA
|
||||||
;;;;
|
;;;;
|
||||||
;;;; ----------------------------------------------------------------
|
;;;; ----------------------------------------------------------------
|
||||||
;;;; threads.scm -- User-level interface to Guile's thread system
|
;;;; threads.scm -- User-level interface to Guile's thread system
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue