]> git.donarmstrong.com Git - lilypond.git/blobdiff - flower/warn.cc
update
[lilypond.git] / flower / warn.cc
index 1df7cda734ace777af149bb0cf9f8b48be95f857..98769fc241f2f5676b1746d395aac3a53eba1824 100644 (file)
@@ -1,37 +1,46 @@
-#include <stream.h>
-#include "warn.hh"
+/*
+  warn.cc -- implement warnings
+
+  source file of the Flower Library
 
+  (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
+
+#include <stdlib.h>
+#include <stdio.h>
+
+#include "warn.hh"
 
 void
-error (String s)
+message (String s)
 {
-  cerr <<  _ ("error: ") << s << '\n';
-
-  exit (1);
+  fputs (s.to_str0 (), stderr);
+  fflush (stderr);
 }
 
 void
-non_fatal_error (String s)
+warning (String s)
 {
-  cerr <<  _ ("error: ") << s << '\n';
+  message (_f ("warning: %s", s.to_str0 ()) + "\n");
 }
 
 void
-warning (String m)
+non_fatal_error (String s)
 {
-  cerr << _ ("warning: ") <<m <<endl;
-
+  message (_f ("error: %s", s.to_str0 ()) + "\n");
 }
 
 void
-message (String m)
+error (String s)
 {
-  cerr << m<<endl;
+  non_fatal_error (s);
+  exit (1);
 }
 
 void
 programming_error (String s)
 {
-  cerr << _("programming error: ") << s << _(" (Continuing; cross thumbs)") << '\n';
+  message (_f ("programming error: %s", s) + "\n");
+  message (_ ("Continuing; crossing fingers") + "\n");
 }