2 translator-scheme.cc -- implement Scheme context functions
4 source file of the GNU LilyPond music typesetter
6 (c) 2002--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
10 #include "context-def.hh"
11 #include "translator-group.hh"
13 LY_DEFINE (ly_translator_name, "ly:translator-name",
15 "Return the type name of the translator object @var{trans}. "
16 "The name is a symbol.")
18 Translator *tr = unsmob_translator (trans);
19 SCM_ASSERT_TYPE (tr, trans, SCM_ARG1, __FUNCTION__, "Translator");
20 char const *nm = classname (tr);
21 return ly_symbol2scm (nm);
24 LY_DEFINE (ly_translator_description, "ly:translator-description",
26 "Return an alist of properties of translator @var{me}.")
28 Translator *tr = unsmob_translator (me);
29 SCM_ASSERT_TYPE (tr, me, SCM_ARG1, __FUNCTION__, "Translator");
30 return tr->translator_description ();
34 Translator::print_smob (SCM s, SCM port, scm_print_state *)
36 Translator *me = (Translator*) SCM_CELL_WORD_1 (s);
37 scm_puts ("#<Translator ", port);
38 scm_puts (classname (me), port);
39 scm_puts (" >", port);