]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/warn.cc
*** empty log message ***
[lilypond.git] / lily / warn.cc
index 4fe33452cce9476826f3e9f13194a60e403fcbf4..04f52b17584d15484f015eb551708e5447b3b505 100644 (file)
@@ -1,81 +1,20 @@
-#include "proto.hh"
-#include "plist.hh"
-#include "debug.hh"
-#include "my-lily-lexer.hh"
-#include "moment.hh"
-#include "time-description.hh"
-#include "source-file.hh"
-#include "source.hh"
-#include "main.hh"
-
-ostream &warnout (cerr);
-ostream *mlog(&cerr);
 /*
-void
-warning(String s)
-{
-    WARN << s;
-}
-*/
+  warn.cc -- implement warning and error messages. Needs cleanup.
 
-void
-error(String s)
-{
-    if (busy_parsing())
-       yyerror(s);
-    else
-       cerr <<  "error: " << s << "\n";
-       
-    exit(1);
-}
+  source file of the GNU LilyPond music typesetter
 
-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);
-}
+  (c)  1997--2003 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
 
-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);
-}
+#include <stdio.h>
 
-void
-message( String message_str, char const* context_ch_c_l )
-{
-    String str = "";           //"lilypond: ";// GNU format messages!
-    Source_file* sourcefile_l = source_l_g->sourcefile_l( context_ch_c_l );
-    if ( sourcefile_l ) {
-       str += sourcefile_l->file_line_no_str(context_ch_c_l) + String(": ");
-    }
-    str += message_str;
-    if ( sourcefile_l ) {
-       str += ":\n";
-       str += sourcefile_l->error_str( context_ch_c_l );
-    }
-    if ( busy_parsing() )
-       cerr << endl;
-    cerr << str << endl;
-}
+#include "string.hh"
+#include "main.hh"
 
 void
-warning( String message_str, char const* context_ch_c_l )
+progress_indication (String s)
 {
-    message( "warning: " + message_str, context_ch_c_l );
+ fputs (s.to_str0 (), stderr);
+ fflush (stderr);
 }
 
-void
-error( String message_str, char const* context_ch_c_l )
-{
-    message( message_str, context_ch_c_l );
-    // since when exits error again?
-    // i-d say: error: errorlevel |= 1; -> no output upon error
-    //          warning: recovery -> output (possibly wrong)
-    if ( lexer )
-        lexer->errorlevel_i_ |= 1;
-//    exit( 1 );
-}