]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/stencil-expression.cc
Merge branch 'master' of git+ssh://jneem@git.sv.gnu.org/srv/git/lilypond
[lilypond.git] / lily / stencil-expression.cc
index d4f5d96011f34a4f167da9e2e8579d3ea7ad6b9e..64ad13d95fbdcb7675a1894cfdd2cf9f1afb084c 100644 (file)
@@ -4,22 +4,22 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
+  (c) 2005--2007 Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
 
 #include "stencil.hh"
 
-#include "protected-scm.hh"
-
-static Protected_scm heads;
+static SCM heads;
 
 void register_stencil_head (SCM symbol)
 {
-  scm_set_object_property_x (symbol, ly_symbol2scm ("stencil-head?"), SCM_BOOL_T);
-  heads = scm_cons (symbol, heads);
+  if (!heads)
+    heads = scm_permanent_object (scm_cons (SCM_EOL, SCM_EOL));
   
+  scm_set_object_property_x (symbol, ly_symbol2scm ("stencil-head?"), SCM_BOOL_T);
+  scm_set_cdr_x (heads,  scm_cons (symbol, scm_cdr (heads)));
 }
+
 bool
 is_stencil_head (SCM symbol)
 {
@@ -30,6 +30,6 @@ is_stencil_head (SCM symbol)
 SCM
 all_stencil_heads ()
 {
-  return heads;
+  return scm_cdr (heads);
 }
-  
+