+/*
+ warn.cc -- implement warnings
+
+ source file of the Flower Library
+
+ (c) 1997--2003 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
+
#include <stdlib.h>
-#include <stream.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\n", s.to_str0 ()));
}
void
-warning (String m)
+non_fatal_error (String s)
{
- cerr << _ ("warning: ") <<m <<endl;
-
+ message (_f ("error: %s\n", s.to_str0 ()));
}
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 (Continuing; cross thumbs)\n",
+ s.to_str0 ()));
}