lilypond-0.1.57
[lilypond.git] / lily / warn.cc
blob86604d585341802bb2d1985cbd5ffe8d03a8d33f
1 /*
2 warn.cc -- implement warning and error messages. Needs cleanup.
4 source file of the GNU LilyPond music typesetter
6 (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
7 */
9 #include "proto.hh"
10 #include "plist.hh"
11 #include "debug.hh"
12 #include "my-lily-lexer.hh"
13 #include "moment.hh"
14 #include "time-description.hh"
15 #include "source-file.hh"
16 #include "source.hh"
17 #include "main.hh"
18 #include "input.hh"
20 ostream &warnout (cerr);
21 ostream *mlog (&cerr);
25 void
26 error_t (String const & s, Moment const & r)
28 String t_mom = r.truncated ().str () + (r - r.truncated ()).str ();
29 String e=s+ " (t = " + t_mom + ")";
30 error (e);
33 void
34 error_t (String const & s, Time_description const &t_tdes)
36 String e=s+ " (at t=" + String(t_tdes.bars_i_) + ": " + (t_tdes.whole_in_measure_).str () + ")\n";
37 error (e);