]> git.donarmstrong.com Git - lilypond.git/blob - lily/translator-scheme.cc
* flower
[lilypond.git] / lily / translator-scheme.cc
1 /*
2   translator-scheme.cc -- implement Scheme context functions
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 2002--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 */
8
9 #include "context-def.hh"
10 #include "translator-group.hh"
11
12 LY_DEFINE (ly_translator_name, "ly:translator-name",
13            1, 0, 0, (SCM trans),
14            "Return the type name of the translator object @var{trans}. "
15            "The name is a symbol.")
16 {
17   Translator *tr = unsmob_translator (trans);
18   SCM_ASSERT_TYPE (tr, trans, SCM_ARG1, __FUNCTION__, "Translator");
19   char const *nm = classname (tr);
20   return ly_symbol2scm (nm);
21 }
22
23 LY_DEFINE (ly_translator_description, "ly:translator-description",
24            1, 0, 0, (SCM me),
25            "Return an alist of properties of  translator @var{me}.")
26 {
27   Translator *tr = unsmob_translator (me);
28   SCM_ASSERT_TYPE (tr, me, SCM_ARG1, __FUNCTION__, "Translator");
29   return tr->translator_description ();
30 }
31
32 int
33 Translator::print_smob (SCM s, SCM port, scm_print_state *)
34 {
35   Translator *me = (Translator *) SCM_CELL_WORD_1 (s);
36   scm_puts ("#<Translator ", port);
37   scm_puts (classname (me), port);
38   scm_puts (" >", port);
39   return 1;
40 }
41