2 lily-guile.hh encapsulate guile
4 source file of the GNU LilyPond music typesetter
6 (c) 1998--2000 Jan Nieuwenhuizen <janneke@gnu.org>
14 #include "direction.hh"
15 #include "flower-proto.hh"
18 #define SCM_PACK(x) ((SCM) x)
22 #define SCM_UNPACK(x) ( x)
26 conversion functions follow the GUILE naming convention, i.e.
30 SCM ly_str02scm (char const*c);
31 SCM ly_deep_copy (SCM);
34 SCM ly_symbol2scm (char const *);
35 String ly_scm2string (SCM s);
36 String ly_symbol2string (SCM);
37 SCM ly_offset2scm (Offset);
38 Offset ly_scm2offset (SCM);
40 Interval ly_scm2interval (SCM);
41 SCM ly_interval2scm (Interval);
43 SCM ly_parse_scm (char const* s, int* n);
44 SCM ly_quote_scm (SCM s);
48 display and print newline.
50 void ly_display_scm (SCM s);
54 void read_lily_scm_file (String);
55 void init_lily_guile ();
60 these conversion functions also do a typecheck on the argument, and
61 return a default value if S has the wrong type.
64 Direction to_dir (SCM s);
65 bool to_boolean (SCM s);
67 void init_ly_protection ();
68 unsigned int ly_scm_hash (SCM s);
70 SCM index_cell (SCM cellp, Direction d);
71 SCM index_set_cell (SCM cellp, Direction d, SCM val);
77 void add_scm_init_func (void (*)());
81 #define MAKE_SCHEME_CALLBACK(TYPE, FUNC) \
82 static SCM TYPE ## _ ## FUNC ## _proc;\
84 TYPE ## _ ## FUNC ## _init_functions () \
86 TYPE ## _ ## FUNC ## _proc = gh_new_procedure1_0 (#TYPE "::" #FUNC, \
87 (SCM(*)(...))TYPE :: FUNC); \
90 ADD_SCM_INIT_FUNC(TYPE ## _ ## FUNC ## _callback, TYPE ## _ ## FUNC ## _init_functions); \
93 #define ADD_SCM_INIT_FUNC(name, func)\
94 class name ## _scm_initter { \
96 name ## _scm_initter () \
98 add_scm_init_func (func); \
100 } _ ## name ## _scm_initter; \
103 #endif // LILY_GUILE_HH