X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fmusic-constructor.cc;h=481b9ebc9026d899109988d1e2fd3d4ba82d7cc6;hb=3e2eab301d69df7682ef4668c1972681e0ac413d;hp=e86672d7c7db6b6eccafc1a5b2979443485c56a6;hpb=7e72a1e50e94a7f9738d62599de79fe7745f600c;p=lilypond.git diff --git a/lily/music-constructor.cc b/lily/music-constructor.cc index e86672d7c7..481b9ebc90 100644 --- a/lily/music-constructor.cc +++ b/lily/music-constructor.cc @@ -1,31 +1,28 @@ -/* - music-constructor.cc -- implement Music_constructor - +/* + music-constructor.cc -- implement Music_constructor + source file of the GNU LilyPond music typesetter - - (c) 2001--2004 Han-Wen Nienhuys - - */ -#include // UGH. -#include + (c) 2001--2005 Han-Wen Nienhuys +*/ -#include "warn.hh" #include "music-constructor.hh" -typedef Music* (*Music_ctor) (); +#include // UGH. +#include -static std::map *ctors_map_; +#include "warn.hh" + +static std::map *ctors_map_; void -add_music_ctor (String s, Music_ctor c) +add_music_ctor (String s, Music_ctor c) { if (!ctors_map_) ctors_map_ = new std::map; - - (*ctors_map_)[s] = c; -} + (*ctors_map_)[s] = c; +} Music_ctor get_music_ctor (String s) @@ -33,17 +30,17 @@ get_music_ctor (String s) if (ctors_map_->find (s) == ctors_map_->end ()) return 0; - return (* ctors_map_)[s]; + return (*ctors_map_)[s]; } -Music* -make_music (String s) +Music * +make_music (String s, SCM init) { Music_ctor c = get_music_ctor (s); if (!c) programming_error (String ("No constructor for music: ") + s); assert (c); - - return (*c) (); + + return (*c) (init); }