]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/lily-guile.hh
release: 1.3.38
[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 /*
19   conversion functions follow the GUILE naming convention, i.e.
20
21     A ly_B2A (B b);
22  */
23 SCM ly_str02scm (char const*c);
24 SCM ly_symbol2scm (char const *);
25 String ly_scm2string (SCM s);
26 String ly_symbol2string (SCM);
27 SCM ly_offset2scm (Offset);
28 Offset ly_scm2offset (SCM);
29
30 SCM ly_parse_scm (char const* s, int* n);
31 SCM ly_quote_scm (SCM s);
32 SCM ly_type (SCM);
33
34 /*
35   display and print newline.
36  */
37 void ly_display_scm (SCM s);
38
39 #include "array.hh"
40
41 void read_lily_scm_file (String);
42 void init_lily_guile ();
43
44 bool isdir_b (SCM s);
45
46 /*
47   these conversion functions also do a typecheck on the argument, and
48   return a default value if S has the wrong type.
49 */
50
51 Direction to_dir (SCM s);
52 bool to_boolean (SCM s);
53
54 void init_ly_protection ();
55 unsigned int ly_scm_hash (SCM s);
56
57 SCM index_cell (SCM cellp, Direction d);
58 SCM index_set_cell (SCM cellp, Direction d, SCM val);
59
60
61 /*
62   snarfing.
63  */
64 void add_scm_init_func (void (*)());
65
66 #define ADD_SCM_INIT_FUNC(name, func)\
67 class name ## _scm_initter {                    \
68 public:\
69   name ## _scm_initter ()                       \
70   {                                             \
71     add_scm_init_func (func);           \
72   }                                             \
73 } _ ## name ## _scm_initter;                    \
74 /* end define */
75
76 #endif // LILY_GUILE_HH