X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fpaper-outputter.cc;h=17ca922592112bc8cda7ac546a7ba4af9ef024e4;hb=a7d058d67feb06da25298c3df77e0740f8069d62;hp=de9c16fc87d9fa5e8dd141cd5f2dcc4054cbd6b1;hpb=6eced6a93bbfda6e6af37a7d77a8e75a5052dbee;p=lilypond.git diff --git a/lily/paper-outputter.cc b/lily/paper-outputter.cc index de9c16fc87..17ca922592 100644 --- a/lily/paper-outputter.cc +++ b/lily/paper-outputter.cc @@ -1,21 +1,34 @@ /* - paper-outputter.cc -- implement Paper_outputter + This file is part of LilyPond, the GNU music typesetter. - source file of the GNU LilyPond music typesetter - - (c) 1997--2005 Han-Wen Nienhuys + Copyright (C) 1997--2010 Han-Wen Nienhuys Jan Nieuwenhuizen + + LilyPond is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + LilyPond is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with LilyPond. If not, see . */ #include "paper-outputter.hh" -#include +#include #include +using namespace std; + #include "dimensions.hh" #include "file-name.hh" #include "font-metric.hh" -#include "input-smob.hh" +#include "input.hh" #include "lily-version.hh" #include "main.hh" #include "output-def.hh" @@ -27,14 +40,21 @@ #include "ly-smobs.icc" -Paper_outputter::Paper_outputter (SCM port, String format) +Paper_outputter::Paper_outputter (SCM port, string format) { file_ = port; output_module_ = SCM_EOL; smobify_self (); - String module_name = "scm output-" + format; - output_module_ = scm_c_resolve_module (module_name.to_str0 ()); + string module_name = "scm output-" + format; + output_module_ = scm_c_resolve_module (module_name.c_str ()); + + /* + Enable errors for undefined stencil routines if + -dwarning-as-error is specified; else enable warnings. + */ + SCM proc = ly_lily_module_constant ("backend-testing"); + scm_call_1 (proc, output_module_); } Paper_outputter::~Paper_outputter () @@ -53,9 +73,10 @@ Paper_outputter::mark_smob (SCM x) } int -Paper_outputter::print_smob (SCM x, SCM p, scm_print_state*) +Paper_outputter::print_smob (SCM /* x */, + SCM p, + scm_print_state *) { - (void) x; scm_puts ("#", p); return 1; } @@ -102,5 +123,14 @@ void Paper_outputter::close () { if (scm_port_p (file_) == SCM_BOOL_T) - scm_close_port (file_); + { + scm_close_port (file_); + /* + Remove the "warning" definitions for missing stencil + expressions so that we start fresh with the next \book + block. --pmccarty + */ + SCM proc = ly_lily_module_constant ("remove-stencil-warnings"); + scm_call_1 (proc, output_module_); + } }