# HG changeset patch # User jwe # Date 1159285424 0 # Node ID fbe7ccb47f62aa19f404528cb7eb290f25bc0c0a # Parent 1aa6a35a855d78d82a2726d8fe184b270f981082 [project @ 2006-09-26 15:43:44 by jwe] diff -r 1aa6a35a855d -r fbe7ccb47f62 src/error.cc --- a/src/error.cc Tue Sep 26 12:46:39 2006 +0000 +++ b/src/error.cc Tue Sep 26 15:43:44 2006 +0000 @@ -429,6 +429,48 @@ } } +static void +error_2 (const char *id, const char *fmt, va_list args) +{ + int init_state = error_state; + + error_1 (std::cerr, "error", id, fmt, args); + + if ((interactive || forced_interactive) + && Vdebug_on_error && init_state == 0 + && octave_call_stack::caller_user_script_or_function ()) + { + unwind_protect_bool (Vdebug_on_error); + Vdebug_on_error = false; + + pr_where ("error"); + + error_state = 0; + + do_keyboard (octave_value_list ()); + + unwind_protect::run (); + } +} + +void +error (const char *fmt, ...) +{ + va_list args; + va_start (args, fmt); + error_2 ("", fmt, args); + va_end (args); +} + +void +error_with_id (const char *id, const char *fmt, ...) +{ + va_list args; + va_start (args, fmt); + error_2 (id, fmt, args); + va_end (args); +} + static int check_state (const std::string& state) { @@ -570,48 +612,6 @@ va_end (args); } -static void -error_2 (const char *id, const char *fmt, va_list args) -{ - int init_state = error_state; - - error_1 (std::cerr, "error", id, fmt, args); - - if ((interactive || forced_interactive) - && Vdebug_on_error && init_state == 0 - && octave_call_stack::caller_user_script_or_function ()) - { - unwind_protect_bool (Vdebug_on_error); - Vdebug_on_error = false; - - pr_where ("error"); - - error_state = 0; - - do_keyboard (octave_value_list ()); - - unwind_protect::run (); - } -} - -void -error (const char *fmt, ...) -{ - va_list args; - va_start (args, fmt); - error_2 ("", fmt, args); - va_end (args); -} - -void -error_with_id (const char *id, const char *fmt, ...) -{ - va_list args; - va_start (args, fmt); - error_2 (id, fmt, args); - va_end (args); -} - void parse_error (const char *fmt, ...) {