2 lily-guile.hh encapsulate guile
4 source file of the GNU LilyPond music typesetter
6 (c) 1998--2000 Jan Nieuwenhuizen <janneke@gnu.org>
15 #define fix_guile_1_3_4_scm_puts(scm_data, port) scm_puts ((char*)scm_data, port)
16 #define scm_puts(scm_data, port) fix_guile_1_3_4_scm_puts (scm_data, port)
18 #include "direction.hh"
19 #include "flower-proto.hh"
22 #define SCM_PACK(x) ((SCM) x)
26 #define SCM_UNPACK(x) ( x)
30 conversion functions follow the GUILE naming convention, i.e.
34 SCM ly_str02scm (char const*c);
35 SCM ly_deep_copy (SCM);
38 SCM ly_symbol2scm (char const *);
39 String ly_scm2string (SCM s);
40 String ly_symbol2string (SCM);
41 SCM ly_offset2scm (Offset);
42 Offset ly_scm2offset (SCM);
44 Interval ly_scm2interval (SCM);
45 SCM ly_interval2scm (Interval);
47 SCM ly_parse_scm (char const* s, int* n);
48 SCM ly_quote_scm (SCM s);
52 display and print newline.
55 void ly_display_scm (SCM s);
60 void read_lily_scm_file (String);
61 void init_lily_guile ();
66 these conversion functions also do a typecheck on the argument, and
67 return a default value if S has the wrong type.
70 Direction to_dir (SCM s);
71 bool to_boolean (SCM s);
73 void init_ly_protection ();
74 unsigned int ly_scm_hash (SCM s);
76 SCM index_cell (SCM cellp, Direction d);
77 SCM index_set_cell (SCM cellp, Direction d, SCM val);
83 void add_scm_init_func (void (*)());
87 #define MAKE_SCHEME_CALLBACK(TYPE, FUNC) \
88 static SCM TYPE ## _ ## FUNC ## _proc;\
90 TYPE ## _ ## FUNC ## _init_functions () \
92 TYPE ## _ ## FUNC ## _proc = gh_new_procedure1_0 (#TYPE "::" #FUNC, \
93 (SCM(*)(SCM))TYPE :: FUNC); \
96 ADD_SCM_INIT_FUNC(TYPE ## _ ## FUNC ## _callback, TYPE ## _ ## FUNC ## _init_functions); \
99 #define ADD_SCM_INIT_FUNC(name, func)\
100 class name ## _scm_initter { \
102 name ## _scm_initter () \
104 add_scm_init_func (func); \
106 } _ ## name ## _scm_initter; \
109 #endif // LILY_GUILE_HH