2 #include "output-def.hh"
4 #include "ly-module.hh"
6 LY_DEFINE(ly_make_book, "ly:make-book",
7 2, 0, 1, (SCM paper, SCM header, SCM scores),
8 "Make a \\book of @var{paper} and @var{header} (which may be #f as well) "
9 "containing @code{\\scores}.")
11 Output_def * odef = unsmob_output_def (paper);
12 SCM_ASSERT_TYPE (odef, paper,
13 SCM_ARG1, __FUNCTION__, "Output_def");
15 Book *book = new Book;
18 if (ly_c_module_p (header))
19 book->header_ = header;
21 for (SCM s = scores; scm_is_pair (s); s = scm_cdr (s))
23 Score *score = unsmob_score (scm_car (s));
25 book->scores_.push (score);
28 SCM x = book->self_scm ();
29 scm_gc_unprotect_object (x);