]> git.donarmstrong.com Git - lilypond.git/blobdiff - flower/warn.cc
* ttftool/parse.c (readNamingTable): handle Apple/8bit encoding too.
[lilypond.git] / flower / warn.cc
index 8bd71328cbb8907a6233a9eb2fb8b41f71631f04..8ac73541b6cf0cc30f2559f32b24c1896ae7424a 100644 (file)
@@ -3,22 +3,41 @@
 
   source file of the Flower Library
 
-  (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
-#include <stdlib.h>
-#include <stdio.h>
-
 #include "warn.hh"
 
+#include <cstdlib>
+#include <cstdio>
+
+/* Is progress indication at NEWLINE?  */
+static bool progress_newline = true;
 
+/* Display user information that is not a full message.  */
 void
-message (String s)
+progress_indication (String s)
 {
+  /* Test if all silly progress_indication ("\n") can be dropped now.  */
+  if (s == "\n")
+    return;
+
   fputs (s.to_str0 (), 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
+message (String s)
+{
+  if (!progress_newline)
+    fputc ('\n', stderr);
+  progress_indication (s);
 }
 
+/* Display a warning message.  Always starts on a new line.  */
 void
 warning (String s)
 {
@@ -31,6 +50,7 @@ non_fatal_error (String s)
   message (_f ("error: %s", s.to_str0 ()) + "\n");
 }
 
+/* Display an error message.  Always starts on a new line.  */
 void
 error (String s)
 {
@@ -42,6 +62,6 @@ void
 programming_error (String s)
 {
   message (_f ("programming error: %s", s) + "\n");
-  message (_ ("Continuing; crossing fingers") + "\n");
+  message (_ ("continuing, cross fingers") + "\n");
 }