2 score-element-callback.cc -- implement Callback smob.
4 source file of the GNU LilyPond music typesetter
6 (c) 2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
10 #include "music-iterator-ctor.hh"
12 static long callback_tag;
21 print_smob (SCM, SCM port, scm_print_state *)
23 scm_puts ("#<encapsulated C++ function>", port);
28 scm_sizet free_smob (SCM)
34 void init_cxx_function_smobs()
36 callback_tag = scm_make_smob_type_mfpe ("callback", 0,
42 smobify_cxx_function (Cxx_function cb )
47 SCM_SETCDR (z, (SCM)cb);
48 SCM_SETCAR (z, (SCM)callback_tag);
55 unsmob_cxx_function (SCM x)
57 if (SCM_CELL_TYPE(x) == callback_tag)
58 return (Cxx_function) SCM_CELL_WORD_1(x);