]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/context-mod.cc
Run grand-replace (issue 3765)
[lilypond.git] / lily / context-mod.cc
index 691f29658d49580ab0d10caf127340b4ad9e7204..2d35e05f836b31278e5a376b8c8d0416c2e07c09 100644 (file)
@@ -1,7 +1,7 @@
 /*
   This file is part of LilyPond, the GNU music typesetter.
 
-  Copyright (C) 2010 Reinhold Kainhofer <reinhold@kainhofer.com>
+  Copyright (C) 2010--2014 Reinhold Kainhofer <reinhold@kainhofer.com>
 
   LilyPond is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
@@ -29,17 +29,23 @@ Context_mod::Context_mod (Context_mod const &s)
   mods_ = s.mods_;
 }
 
+Context_mod::Context_mod (SCM mod_list)
+{
+  mods_ = scm_reverse (mod_list);
+}
+
 #include "ly-smobs.icc"
 IMPLEMENT_SIMPLE_SMOBS (Context_mod);
 IMPLEMENT_DEFAULT_EQUAL_P (Context_mod);
+IMPLEMENT_TYPE_P (Context_mod, "ly:context-mod?");
 
 int
-Context_mod::print_smob (SCM smob, SCM port, scm_print_state*)
+Context_mod::print_smob (SCM smob, SCM port, scm_print_state *)
 {
   Context_mod *me = (Context_mod *) SCM_CELL_WORD_1 (smob);
 
   scm_puts ("#<Context_mod ", port);
-  scm_display (me->mods_, port);
+  scm_display (me->get_mods (), port);
   scm_puts (">", port);
   return 1;
 }
@@ -47,11 +53,10 @@ Context_mod::print_smob (SCM smob, SCM port, scm_print_state*)
 SCM
 Context_mod::mark_smob (SCM smob)
 {
-  ASSERT_LIVE_IS_ALLOWED ();
+  ASSERT_LIVE_IS_ALLOWED (smob);
 
   Context_mod *me = (Context_mod *) SCM_CELL_WORD_1 (smob);
 
-  scm_gc_mark (me->mods_);
   return me->mods_;
 }