lo-error.h

Go to the documentation of this file.
00001 /*
00002 
00003 Copyright (C) 1996-2012 John W. Eaton
00004 
00005 This file is part of Octave.
00006 
00007 Octave is free software; you can redistribute it and/or modify it
00008 under the terms of the GNU General Public License as published by the
00009 Free Software Foundation; either version 3 of the License, or (at your
00010 option) any later version.
00011 
00012 Octave is distributed in the hope that it will be useful, but WITHOUT
00013 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00014 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00015 for more details.
00016 
00017 You should have received a copy of the GNU General Public License
00018 along with Octave; see the file COPYING.  If not, see
00019 <http://www.gnu.org/licenses/>.
00020 
00021 */
00022 
00023 #if !defined (octave_liboctave_error_h)
00024 #define octave_liboctave_error_h 1
00025 
00026 #ifdef __cplusplus
00027 extern "C" {
00028 #endif
00029 
00030 extern void liboctave_fatal (const char *fmt, ...) GCC_ATTR_NORETURN;
00031 
00032 extern void liboctave_fatal_with_id (const char *id, const char *fmt, ...) GCC_ATTR_NORETURN;
00033 
00034 extern void liboctave_warning (const char *fmt, ...);
00035 
00036 extern void liboctave_warning_with_id (const char *id, const char *fmt, ...);
00037 
00038 typedef void (*liboctave_error_handler) (const char *, ...);
00039 
00040 typedef void (*liboctave_error_with_id_handler) (const char *, const char *, ...);
00041 
00042 typedef void (*liboctave_warning_handler) (const char *, ...);
00043 
00044 typedef void (*liboctave_warning_with_id_handler) (const char *, const char *, ...);
00045 
00046 /* Would be nice to make these pointers private, but we want to share
00047    them among all the liboctave classes. */
00048 CRUFT_API extern liboctave_error_handler current_liboctave_error_handler;
00049 
00050 CRUFT_API extern liboctave_error_with_id_handler current_liboctave_error_with_id_handler;
00051 
00052 CRUFT_API extern liboctave_warning_handler current_liboctave_warning_handler;
00053 
00054 CRUFT_API extern liboctave_warning_with_id_handler current_liboctave_warning_with_id_handler;
00055 
00056 CRUFT_API extern void set_liboctave_error_handler (liboctave_error_handler f);
00057 
00058 CRUFT_API extern void set_liboctave_error_with_id_handler (liboctave_error_with_id_handler f);
00059 
00060 CRUFT_API extern void set_liboctave_warning_handler (liboctave_warning_handler f);
00061 
00062 CRUFT_API extern void set_liboctave_warning_with_id_handler (liboctave_warning_with_id_handler f);
00063 
00064 #ifdef __cplusplus
00065 }
00066 #endif
00067 
00068 #endif
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines