2 object-key-undumper-scheme.cc -- implement Object_key_undumper bindings
4 source file of the GNU LilyPond music typesetter
6 (c) 2005--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
9 #include "object-key-undumper.hh"
11 LY_DEFINE (ly_undumper_read_keys, "ly:undumper-read-keys",
13 (SCM undumper, SCM keys),
14 "Read serialized @var{keys} into @var{undumper}.")
16 Object_key_undumper *u = unsmob_key_undumper (undumper);
17 SCM_ASSERT_TYPE (u, undumper, SCM_ARG1, __FUNCTION__, "Undumper");
19 u->parse_contents (keys);
20 return SCM_UNSPECIFIED;
23 LY_DEFINE (ly_make_undumper, "ly:make-undumper",
26 "Create a key undumper. ")
28 Object_key_undumper *u = new Object_key_undumper ();
29 return u->unprotect ();
32 LY_DEFINE (ly_undumper_lookup, "ly:undumper-lookup",
34 (SCM undumper, SCM serial),
35 "Return the object key for number @var{serial}. ")
38 Object_key_undumper *u = unsmob_key_undumper (undumper);
40 SCM_ASSERT_TYPE (u, undumper, SCM_ARG1, __FUNCTION__, "undumper");
41 SCM_ASSERT_TYPE (scm_is_integer (serial), serial, SCM_ARG2, __FUNCTION__, "integer");
42 return u->get_key (scm_to_int (serial))->self_scm ();