summaryrefslogtreecommitdiff
path: root/src/Fl_System_Driver.cxx
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2016-03-28 15:22:20 +0000
committerManolo Gouy <Manolo>2016-03-28 15:22:20 +0000
commit28d1a2d6848d5abe555fd0ddae8b57cec6f900ca (patch)
treebb17efad1d942a3fee09b0ef9e858677060e2230 /src/Fl_System_Driver.cxx
parent244a1a5bc439c0a3427e78f1dac9623b85f161bb (diff)
Rewrite Fl_abort.cxx under the driver model.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11452 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_System_Driver.cxx')
-rw-r--r--src/Fl_System_Driver.cxx42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/Fl_System_Driver.cxx b/src/Fl_System_Driver.cxx
index 711d9abaa..9a372885d 100644
--- a/src/Fl_System_Driver.cxx
+++ b/src/Fl_System_Driver.cxx
@@ -19,6 +19,8 @@
#include <FL/Fl_System_Driver.H>
#include <stdlib.h>
+#include <stdio.h>
+#include <stdarg.h>
const int Fl_System_Driver::flNoValue = 0x0000;
const int Fl_System_Driver::flWidthValue = 0x0004;
@@ -38,6 +40,46 @@ Fl_System_Driver::~Fl_System_Driver()
{
}
+void Fl_System_Driver::warning(const char* format, ...) {
+ va_list args;
+ va_start(args, format);
+ driver()->warning(format, args);
+ va_end(args);
+}
+
+void Fl_System_Driver::warning(const char* format, va_list args) {
+ vfprintf(stderr, format, args);
+ fputc('\n', stderr);
+ fflush(stderr);
+}
+
+void Fl_System_Driver::error(const char* format, ...) {
+ va_list args;
+ va_start(args, format);
+ driver()->error(format, args);
+ va_end(args);
+}
+
+void Fl_System_Driver::error(const char *format, va_list args) {
+ vfprintf(stderr, format, args);
+ fputc('\n', stderr);
+ fflush(stderr);
+}
+
+void Fl_System_Driver::fatal(const char* format, ...) {
+ va_list args;
+ va_start(args, format);
+ driver()->fatal(format, args);
+ va_end(args);
+}
+
+void Fl_System_Driver::fatal(const char *format, va_list args) {
+ vfprintf(stderr, format, args);
+ fputc('\n', stderr);
+ fflush(stderr);
+ exit(1);
+}
+
/* the following function was stolen from the X sources as indicated. */
/* Copyright Massachusetts Institute of Technology 1985, 1986, 1987 */