comparison src/error.cc @ 3491:2c7524ffdbf5

[project @ 2000-01-28 22:44:13 by jwe]
author jwe
date Fri, 28 Jan 2000 22:44:14 +0000
parents fc5eac74640d
children d14c483b3c12
comparison
equal deleted inserted replaced
3490:fc5eac74640d 3491:2c7524ffdbf5
54 // the `unwind_protect' statement. 54 // the `unwind_protect' statement.
55 bool buffer_error_messages = false; 55 bool buffer_error_messages = false;
56 56
57 // The message buffer 57 // The message buffer
58 ostrstream *error_message_buffer = 0; 58 ostrstream *error_message_buffer = 0;
59
60 // Warning messages are never buffered.
61 // XXX FIXME XXX -- we should provide another way to turn them off...
62
63 static void
64 vwarning (const char *name, const char *fmt, va_list args)
65 {
66 flush_octave_stdout ();
67
68 ostrstream output_buf;
69
70 if (name)
71 {
72 octave_diary << name << ": ";
73 cerr << name << ": ";
74 }
75
76 octave_diary.vform (fmt, args);
77 cerr.vform (fmt, args);
78
79 octave_diary << endl;
80 cerr << endl;
81 }
59 82
60 static void 83 static void
61 verror (const char *name, const char *fmt, va_list args) 84 verror (const char *name, const char *fmt, va_list args)
62 { 85 {
63 flush_octave_stdout (); 86 flush_octave_stdout ();
173 warning (const char *fmt, ...) 196 warning (const char *fmt, ...)
174 { 197 {
175 va_list args; 198 va_list args;
176 va_start (args, fmt); 199 va_start (args, fmt);
177 warning_state = 1; 200 warning_state = 1;
178 verror ("warning", fmt, args); 201 vwarning ("warning", fmt, args);
179 va_end (args); 202 va_end (args);
180 } 203 }
181 204
182 void 205 void
183 error (const char *fmt, ...) 206 error (const char *fmt, ...)