]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/lily-guile.hh
release: 1.3.29
[lilypond.git] / lily / include / lily-guile.hh
1 /*
2   lily-guile.hh encapsulate guile
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 1998--2000 Jan Nieuwenhuizen <janneke@gnu.org>
7 */
8
9 #ifndef LILY_GUILE_HH
10 #define LILY_GUILE_HH
11
12 #include  "string.hh"
13
14 #include <guile/gh.h>
15 #include <libguile.h>
16 #include "direction.hh"
17
18 SCM ly_str02scm (char const*c);
19 SCM ly_eval_str (String s);
20 SCM ly_symbol2scm (char const *);
21 String ly_symbol2string (SCM);
22
23 SCM ly_eval (SCM a);
24 SCM ly_parse_scm (char const* s, int* n);
25 SCM ly_quote_scm (SCM s);
26 void ly_display_scm (SCM s);
27 String ly_scm2string (SCM s);
28
29 #include "array.hh"
30
31 void read_lily_scm_file (String);
32 void init_lily_guile ();
33
34 bool isdir_b (SCM s);
35 Direction to_dir (SCM s);
36
37 bool to_boolean (SCM s);
38
39 void init_ly_protection ();
40 unsigned int ly_scm_hash (SCM s);
41
42 SCM index_cell (SCM cellp, Direction d);
43 SCM index_set_cell (SCM cellp, Direction d, SCM val);
44
45 template<class T>SCM array_to_scm (Array<T> arr);
46 template<class T>void scm_to_array (SCM s, Array<T>* arr);
47
48 //URG how templates suck!
49 SCM to_scm (int i);
50 int scm_to (SCM s, int* i);
51
52 SCM to_scm (Real r);
53 Real scm_to (SCM s, Real* r);
54
55 SCM to_scm (Offset o);
56 Offset scm_to (SCM s, Offset* o);
57
58 /*
59   snarfing.
60  */
61 void add_scm_init_func (void (*)());
62
63 #define ADD_SCM_INIT_FUNC(name, func)\
64 class name ## _scm_initter {                    \
65 public:\
66   name ## _scm_initter ()                       \
67   {                                             \
68     add_scm_init_func (func);           \
69   }                                             \
70 } _ ## name ## _scm_initter;                    \
71 /* end define */
72
73 #endif // LILY_GUILE_HH