]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/book-scheme.cc
don't use guile -e main execution.
[lilypond.git] / lily / book-scheme.cc
index f430377fce47f2ffd3c291ff9bec6d573b2818b0..750917187f65a86612d86fe0d21b2959010be73e 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 2004--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c) 2004--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
 
 #include "book.hh"
@@ -31,7 +31,7 @@ LY_DEFINE (ly_make_book, "ly:make-book",
   book->scores_ = scm_append (scm_list_2 (scores, book->scores_));
 
   SCM x = book->self_scm ();
-  scm_gc_unprotect_object (x);
+  book->unprotect ();
   return x;
 }
 
@@ -39,8 +39,11 @@ LY_DEFINE (ly_parser_print_book, "ly:book-process",
           4, 0, 0, (SCM book_smob,
                     SCM default_paper,
                     SCM default_layout,
-                    SCM basename),
-          "Print book.")
+                    SCM output),
+          "Print book. @var{output} is passed to the backend unchanged. "
+          "Eg. it may be "
+          "a string (for file based outputs) or a socket (for network based "
+          "output).")
 {
   Book *book = unsmob_book (book_smob);
 
@@ -49,17 +52,13 @@ LY_DEFINE (ly_parser_print_book, "ly:book-process",
                   default_layout, SCM_ARG2, __FUNCTION__, "\\paper block");
   SCM_ASSERT_TYPE (unsmob_output_def (default_layout),
                   default_layout, SCM_ARG3, __FUNCTION__, "\\layout block");
-  SCM_ASSERT_TYPE (scm_is_string (basename), basename, SCM_ARG4, __FUNCTION__, "string");
 
-  String base = ly_scm2string (basename);
-  Paper_book *pb = book->process (base,
-                                 unsmob_output_def (default_paper),
-                                 unsmob_output_def (default_layout)
-                                 );
+  Paper_book *pb = book->process (unsmob_output_def (default_paper),
+                                 unsmob_output_def (default_layout));
   if (pb)
     {
-      pb->output (base);
-      scm_gc_unprotect_object (pb->self_scm ());
+      pb->output (output);
+      pb->unprotect ();
     }
 
   return SCM_UNSPECIFIED;