]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/scope.cc
release: 1.5.4
[lilypond.git] / lily / scope.cc
index 5fd04e4257c5e02f36ae54fd6d21f79dfeceb385..f578433a800d1e39ec5d8e71a96e6adfde95a3b3 100644 (file)
@@ -3,47 +3,32 @@
   
   source file of the GNU LilyPond music typesetter
   
-  (c) 1998--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c) 1998--2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
   
  */
 
 #include "scope.hh"
-#include "identifier.hh"
+#include "string.hh"
 #include "scm-hash.hh"
 
-
-Scope::~Scope ()
+Scope::Scope (Scheme_hash_table * st)
 {
-  scm_unprotect_object (id_dict_->self_scm ());
-}
-
-Scope::Scope (Scope const&s)
-{
-  id_dict_ =new Scheme_hash_table (*s.id_dict_);
-}
-
-Scope::Scope ()
-{
-  id_dict_ = new Scheme_hash_table;
+  assert (st);
+  id_dict_ =st;
 }
 
 bool
 Scope::elem_b (String s) const
 {
-  return id_dict_->elem_b (ly_symbol2scm (s.ch_C()));
+  return id_dict_->elem_b (ly_symbol2scm (s.ch_C ()));
 }
 
-
 bool
 Scope::elem_b (SCM s) const
 {
   return id_dict_->elem_b (s);
 }
-Identifier*
-Scope::elem (SCM s)const
-{
-  return unsmob_identifier  (id_dict_->get (s));
-}
+
 
 SCM
 Scope::scm_elem (SCM s)const
@@ -54,25 +39,14 @@ Scope::scm_elem (SCM s)const
 SCM
 Scope::scm_elem (String s) const
 {
- return scm_elem (ly_symbol2scm (s.ch_C()));
+ return scm_elem (ly_symbol2scm (s.ch_C ()));
 }
 
-Identifier*
-Scope::elem (String s)const
-{
-  return elem (ly_symbol2scm (s.ch_C()));
-}
 
 void
 Scope::set (String s, SCM id)
 {
-  return id_dict_->set (ly_symbol2scm (s.ch_C()), id);
-}
-
-void
-Scope::set (String s, Identifier * id) 
-{
-  return id_dict_->set (ly_symbol2scm (s.ch_C()), id->self_scm ());
+  return id_dict_->set (ly_symbol2scm (s.ch_C ()), id);
 }
 
 SCM