-#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");
}