]> git.donarmstrong.com Git - lilypond.git/blob - lily/lily-guile.cc
patch::: 1.1.8.hwn3
[lilypond.git] / lily / lily-guile.cc
1 /*
2   lily-guile.cc -- implement assorted guile functions
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 1998 Jan Nieuwenhuizen <janneke@gnu.org>
7
8   Han-Wen Nienhuys <hanwen@cs.uu.nl>
9 */
10
11 #include <stdio.h>
12 #include "libc-extension.hh"
13 #include "lily-guile.hh"
14 #include "main.hh"
15 #include "simple-file-storage.hh"
16 #include "file-path.hh"
17
18
19 /*
20   scm_m_quote doesn't use any env, but needs one for a good signature in GUILE.
21
22   Why there is no gh_quote () in GUILE  beats me.
23 */
24
25 SCM
26 ly_quote_scm (SCM s)
27 {
28   return scm_cons2 (scm_i_quote, s, SCM_EOL);
29 }
30
31 /*
32   See: libguile/symbols.c
33
34   SCM
35   scm_string_to_symbol(s)
36   
37 */
38 SCM
39 ly_symbol (String name)
40 {
41   return gh_car (scm_intern (name.ch_C(), name.length_i()));
42 }
43
44 /**
45
46    Read a file, and shove it down GUILE.  GUILE also has file read
47    functions, but you can't fiddle with the path of those.
48    
49  */
50
51 void
52 read_lily_scm_file (String fn)
53 {
54   String s = global_path.find (fn);
55   Simple_file_storage f(s);
56   
57   gh_eval_str ((char *) f.ch_C());
58 }