+
+ input_location_ = Input ().smobbed_copy ();
+}
+
+Book::Book (Book const &s)
+ : Smob<Book> ()
+{
+ paper_ = 0;
+ header_ = SCM_EOL;
+ scores_ = SCM_EOL;
+ bookparts_ = SCM_EOL;
+ input_location_ = SCM_EOL;
+ smobify_self ();
+
+ if (s.paper_)
+ {
+ paper_ = s.paper_->clone ();
+ paper_->unprotect ();
+ }
+
+ input_location_ = s.origin ()->smobbed_copy ();
+
+ header_ = ly_make_module (false);
+ if (ly_is_module (s.header_))
+ ly_module_copy (header_, s.header_);
+ SCM *t = &scores_;
+ for (SCM p = s.scores_; scm_is_pair (p); p = scm_cdr (p))
+ {
+ SCM entry = scm_car (p);
+
+ if (Score *newscore = unsmob<Score> (entry))
+ * t = scm_cons (newscore->clone ()->unprotect (), SCM_EOL);
+ else if (Page_marker *marker = unsmob<Page_marker> (entry))
+ * t = scm_cons (marker->clone ()->unprotect (), SCM_EOL);
+ else
+ {
+ /* This entry is a markup list */
+ *t = scm_cons (entry, SCM_EOL);
+ }
+ t = SCM_CDRLOC (*t);
+ }
+
+ t = &bookparts_;
+ for (SCM p = s.bookparts_; scm_is_pair (p); p = scm_cdr (p))
+ {
+ Book *newpart = unsmob<Book> (scm_car (p))->clone ();
+
+ *t = scm_cons (newpart->self_scm (), SCM_EOL);
+ t = SCM_CDRLOC (*t);
+ newpart->unprotect ();
+ }
+}
+
+Input *
+Book::origin () const
+{
+ return unsmob<Input> (input_location_);