X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=flower%2Fwarn.cc;h=74be7c2453ba6c22666639b7d7043d96e1ba8eaf;hb=5b4b0d6e9a197e8f9eb085b7c2ad78b8be3e5cfc;hp=4fa9dcd2052173a2a6c4d2a3c8ded8fa169dd261;hpb=3a7b6b3cbd35499a0993d46c302f37853f1b9c51;p=lilypond.git diff --git a/flower/warn.cc b/flower/warn.cc index 4fa9dcd205..74be7c2453 100644 --- a/flower/warn.cc +++ b/flower/warn.cc @@ -1,38 +1,71 @@ -#include -#include +/* + warn.cc -- implement warnings + + source file of the Flower Library + + (c) 1997--2008 Han-Wen Nienhuys +*/ + #include "warn.hh" +#include +#include + +#include "international.hh" + +using namespace std; + +/* Is progress indication at NEWLINE? */ +static bool progress_newline = true; +/* Display user information that is not a full message. */ void -error (String s) +progress_indication (string s) { - cerr << _ ("error: ") << s << '\n'; + /* Test if all silly progress_indication ("\n") can be dropped now. */ + if (s == "\n") + return; - exit (1); + fputs (s.c_str (), stderr); + fflush (stderr); + if (s.length ()) + progress_newline = s[s.length () - 1] == '\n'; } +/* Display a single user message. Always starts on a new line. */ void -non_fatal_error (String s) +message (string s) { - cerr << _ ("error: ") << s << '\n'; + if (!progress_newline) + fputc ('\n', stderr); + progress_indication (s); } +/* Display a warning message. Always starts on a new line. */ void -warning (String m) +warning (string s) { - cerr << _ ("warning: ") <