]> git.donarmstrong.com Git - lilypond.git/blob - scm/standalone.scm
Fix some bugs in the dynamic engraver and PostScript backend
[lilypond.git] / scm / standalone.scm
1 ;;;; standalone.scm -- implement Scheme stuff for use without LilyPond
2 ;;;;
3 ;;;;  source file of the GNU LilyPond music typesetter
4 ;;;; 
5 ;;;; (c) 1998--2006 Jan Nieuwenhuizen <janneke@gnu.org>
6 ;;;;                 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7
8 (define standalone (not (defined? 'ly:gulp-file)))
9 ;;(write standalone (current-error-port))
10
11 (define (gulp-file name)
12   (let* ((file (open-input-file name))
13          (text (read-delimited "" file)))
14     (close file)
15     text))
16
17 (define (scm-gulp-file name)
18   (set! %load-path 
19         (cons (string-append (getenv 'LILYPONDPREFIX) "/ly")
20               (cons (string-append (getenv 'LILYPONDPREFIX) "/ps")
21                     %load-path)))
22   (let ((path (%search-load-path name)))
23        (if path
24            (gulp-file path)
25            (gulp-file name))))
26
27 (define (scm-number->string x)
28   (let ((e (inexact->exact x)))
29     (string-append (if (= e x)
30                        (number->string e)
31                        (number->string x))
32                    " ")))
33
34 (define ly:gulp-file scm-gulp-file)
35 (define ly:number->string scm-number->string)
36
37 (eval-string (ly:gulp-file "lily.scm"))