]> git.donarmstrong.com Git - lilypond.git/blob - scm/file-cache.scm
2dfed77686e4b02421a2b3b90b2660c144368d47
[lilypond.git] / scm / file-cache.scm
1 ;;;; file-cache.scm --
2 ;;;;
3 ;;;;  source file of the GNU LilyPond music typesetter
4 ;;;;
5 ;;;; (c) 2005--2007 Han-Wen Nienhuys <hanwen@xs4all.nl>
6
7
8 (define cache-hash-tab  (make-hash-table 11))
9 (define-public (cached-file-contents filename)
10   (let*
11       ((contents (hash-ref cache-hash-tab filename #f)))
12
13     (if (not (string? contents))
14         (begin
15           (set! contents (ly:gulp-file filename))
16           (hash-set! cache-hash-tab filename contents)))
17     contents))