]> git.donarmstrong.com Git - lilypond.git/blob - lily/warn.cc
release: 1.1.32
[lilypond.git] / lily / warn.cc
1 /*
2   warn.cc -- implement warning and error messages. Needs cleanup.
3
4   source file of the GNU LilyPond music typesetter
5
6   (c)  1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 */
8
9 #include "proto.hh"
10 #include "debug.hh"
11 #include "my-lily-lexer.hh"
12 #include "moment.hh"
13 #include "time-description.hh"
14 #include "source-file.hh"
15 #include "source.hh"
16 #include "main.hh"
17 #include "input.hh"
18
19 ostream &warnout (cerr);
20 ostream *mlog (&cerr);
21
22
23
24 void
25 error_t (String const & s, Moment const & r)
26 {
27   String t_mom = r.trunc_rat ().str () +  (r - r.trunc_rat ()).str ();
28   String e=s+ " (t = " +  t_mom + ")";
29   error (e);
30 }
31
32 void
33 error_t (String const & s, Time_description const &t_tdes)
34 {
35   String e=s+ " (at t=" +  to_str (t_tdes.bars_i_) + ": " +  (t_tdes.whole_in_measure_).str () + ")\n";
36   error (e);
37 }