]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/music-constructor.cc
* scripts/lilypond-invoke-editor.scm (dissect-uri): Handle URIs
[lilypond.git] / lily / music-constructor.cc
index e6d5c11de7f4e446cbcd7c32495b24a7818e3715..481b9ebc9026d899109988d1e2fd3d4ba82d7cc6 100644 (file)
@@ -1,29 +1,27 @@
-/*   
-  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 <hanwen@cs.uu.nl>
-  
- */
 
-#include <map>                 // UGH.
-#include <assert.h>
+  (c) 2001--2005  Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
 
-#include "warn.hh"
 #include "music-constructor.hh"
 
-typedef Music *(*Music_ctor) ();
+#include <map>                 // UGH.
+#include <cassert>
+
+#include "warn.hh"
 
-static std::map<String,Music_ctor> *ctors_map_;
+static std::map<String, Music_ctor> *ctors_map_;
 
 void
 add_music_ctor (String s, Music_ctor c)
 {
   if (!ctors_map_)
     ctors_map_ = new std::map<String, Music_ctor>;
-  
- (*ctors_map_)[s] = c;
+
 (*ctors_map_)[s] = c;
 }
 
 Music_ctor
@@ -35,14 +33,14 @@ get_music_ctor (String 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);
 }