2 warn.cc -- implement warnings
4 source file of the Flower Library
6 (c) 1997--2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
15 /* Is progress indication at NEWLINE? */
16 static bool progress_newline = true;
18 /* Display user information that is not a full message. */
20 progress_indication (String s)
22 /* Test if all silly progress_indication ("\n") can be dropped now. */
26 fputs (s.to_str0 (), stderr);
29 progress_newline = s[s.length () - 1] == '\n';
32 /* Display a single user message. Always starts on a new line. */
36 if (!progress_newline)
38 progress_indication (s);
41 /* Display a warning message. Always starts on a new line. */
45 message (_f ("warning: %s", s.to_str0 ()) + "\n");
49 non_fatal_error (String s)
51 message (_f ("error: %s", s.to_str0 ()) + "\n");
54 /* Display an error message. Always starts on a new line. */
63 programming_error (String s)
65 message (_f ("programming error: %s", s) + "\n");
66 message (_ ("continuing, cross fingers") + "\n");