]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/warn.cc
release: 1.1.58
[lilypond.git] / lily / warn.cc
index 08c8b526960dbc03f1be58e4a0ad1b39ee4afa06..532d2e3fb89809227264adfcfd3a3595778d9c92 100644 (file)
@@ -1,13 +1,12 @@
 /*
   warn.cc -- implement warning and error messages. Needs cleanup.
 
-  source file of the LilyPond music typesetter
+  source file of the GNU LilyPond music typesetter
 
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+  (c)  1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
 #include "proto.hh"
-#include "plist.hh"
 #include "debug.hh"
 #include "my-lily-lexer.hh"
 #include "moment.hh"
 #include "input.hh"
 
 ostream &warnout (cerr);
-ostream *mlog(&cerr);
+ostream *mlog (&cerr);
 
 
-void
-error(String s)
-{
-    cerr <<  "error: " << s << "\n";
-       
-    exit(1);
-}
-
-void
-error_t(String const & s, Moment const & r)
-{
-    String t_mom = String(trunc(r)) + String(r - Moment(trunc(r)));
-    String e=s+ " (t = " +  t_mom + ")";
-    error(e);
-}
-
-void
-error_t(String const & s, Time_description const &t_tdes)
-{
-    String e=s+ " (at t=" + String(t_tdes.bars_i_) + ": " + String(t_tdes.whole_in_measure_) + ")\n";
-    error(e);
-}
 
 void
-warning(String m)
+error_t (String const & s, Moment const & r)
 {
-    cerr << "warning" <<m <<endl;
-
+  String t_mom = r.trunc_rat ().str () +  (r - r.trunc_rat ()).str ();
+  String e=s+ " (t = " +  t_mom + ")";
+  error (e);
 }
 
 void
-message(String m)
+error_t (String const & s, Time_description const &t_tdes)
 {
-    cerr << m<<endl;
+  String e=s+ " (at t=" +  to_str (t_tdes.bars_i_) + ": " +  (t_tdes.whole_in_measure_).str () + ")\n";
+  error (e);
 }