2 grob-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"
11 #include "ly-smobs.icc"
13 static long callback_tag
;
22 print_smob (SCM
, SCM port
, scm_print_state
*)
24 scm_puts ("#<encapsulated C++ function>", port
);
29 scm_sizet
free_smob (SCM
)
35 void init_cxx_function_smobs()
37 callback_tag
= scm_make_smob_type_mfpe ("callback", 0,
43 smobify_cxx_function (Cxx_function cb
)
48 SCM_SETCDR (z
, (SCM
)cb
);
49 SCM_SETCAR (z
, (SCM
)callback_tag
);
56 unsmob_cxx_function (SCM x
)
58 if (SCM_CELL_TYPE(x
) == callback_tag
)
59 return (Cxx_function
) SCM_CELL_WORD_1(x
);