]> git.donarmstrong.com Git - lilypond.git/blob - lily/grob-interface-scheme.cc
Run `make grand-replace'.
[lilypond.git] / lily / grob-interface-scheme.cc
1 /*
2   grob-interface-scheme.cc -- implement grob interface bindings.
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 2005--2008 Han-Wen Nienhuys <hanwen@xs4all.nl>
7 */
8
9 #include "lily-guile.hh"
10 #include "std-string.hh"
11
12 static SCM all_ifaces;
13
14 void
15 internal_add_interface (SCM a, SCM b, SCM c)
16 {
17   if (!all_ifaces)
18     {
19       SCM tab = scm_c_make_hash_table (59);
20       all_ifaces = tab;
21       scm_permanent_object (tab);
22     }
23   
24   SCM entry = scm_list_n (a, b, c, SCM_UNDEFINED);
25
26   scm_hashq_set_x (all_ifaces, a, entry);
27 }
28
29 LY_DEFINE (ly_add_interface, "ly:add-interface",
30            3, 0, 0, (SCM a, SCM b, SCM c),
31            "Add an interface description.")
32 {
33   LY_ASSERT_TYPE (ly_is_symbol, a, 1);
34   LY_ASSERT_TYPE (scm_is_string, b, 2);
35   LY_ASSERT_TYPE (ly_is_list, c, 3);
36
37   internal_add_interface (a,b,c);
38
39   return SCM_UNSPECIFIED;
40 }
41
42 LY_DEFINE (ly_all_grob_interfaces, "ly:all-grob-interfaces",
43            0, 0, 0, (),
44            "Get a hash table with all interface descriptions.")
45 {
46   return all_ifaces;
47 }
48