2 protected-scm.cc -- implement Protected_scm
4 source file of the GNU LilyPond music typesetter
6 (c) 1998--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
9 #include "protected-scm.hh"
10 #include "lily-guile.hh"
14 #define PROTECT ly_protect_scm
15 #define UNPROTECT ly_unprotect_scm
17 #define PROTECT scm_protect_object
18 #define UNPROTECT scm_unprotect_object
21 Protected_scm::Protected_scm ()
26 Protected_scm::Protected_scm (SCM s)
28 object_ = s ? PROTECT (s): 0;
31 Protected_scm::Protected_scm (Protected_scm const &s)
33 object_ = s.object_ ? PROTECT (s.object_) : 0;
37 Protected_scm::operator =(SCM s)
44 object_ = s ? PROTECT (s): 0;
49 Protected_scm::operator = (Protected_scm const &s)
51 return operator= (s.object_);
55 Protected_scm::~Protected_scm ()
60 object_ =0L; // be nice to conservative GC
64 Protected_scm::operator SCM () const
70 Protected_scm::to_SCM () const