X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=flower%2Fwarn.cc;h=74be7c2453ba6c22666639b7d7043d96e1ba8eaf;hb=5b4b0d6e9a197e8f9eb085b7c2ad78b8be3e5cfc;hp=9cfd19e3f281e9d79f1634b867f60a737a1d95af;hpb=fc3e875d6bf06f0680e897faffdcab36ad975a03;p=lilypond.git diff --git a/flower/warn.cc b/flower/warn.cc index 9cfd19e3f2..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: ") <