-/* This function does not dump the output; outname is required eg. for
- dumping header fields. */
-Paper_book *
-Book::process (String outname, Output_def *default_def)
+void
+Book::set_parent (Book *parent)
+{
+ if (!paper_)
+ {
+ paper_ = new Output_def ();
+ paper_->unprotect ();
+ }
+ paper_->parent_ = parent->paper_;
+
+ if ((header_ == SCM_EOL) && (scm_is_null (parent->bookparts_)))
+ {
+ /* If this is the first part, and it has no header, copy the
+ * parent header */
+ header_ = ly_make_anonymous_module (false);
+ if (ly_is_module (parent->header_))
+ ly_module_copy (header_, parent->header_);
+ }
+}
+
+void
+Book::add_bookpart ()
+{
+ if (scm_is_pair (scores_))
+ {
+ /* If scores have been added to this book, add them to a child
+ * book part */
+ Book *part = new Book;
+ part->set_parent (this);
+ part->scores_ = scores_;
+ bookparts_ = scm_cons (part->self_scm (), bookparts_);
+ part->unprotect ();
+ scores_ = SCM_EOL;
+ }
+}
+
+void
+Book::add_bookpart (SCM b)
+{
+ add_bookpart ();
+ Book *part = unsmob_book (b);
+ part->set_parent (this);
+ bookparts_ = scm_cons (b, bookparts_);
+}
+
+bool
+Book::error_found ()