/*
* The Spar Library - modular math parser
* Copyright (C) 2000,2001 Davide Angelocola <davide178@inwind.it>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
*/
#ifndef _sl_error_h_
#define _sl_error_h_
#include <spar/sl_errno.h>
#include <spar/sl_conf.h>
/**
* Default messages prefixs
*/
typedef enum sl_error_class
{
/**
* This value means that this error is a parser error, then
* a long jump is done in the level0 function to make possible
* the error recover.
*/
SL_ERROR_CLASS_PARSER,
/**
* This value means a generic error (using an error code)
* this error is a significative error, but isn't fatal
*/
SL_ERROR_CLASS_ERROR,
/**
* This error is fatal. No error recover. The sl_de_init function is
* called before exit.
*/
SL_ERROR_CLASS_FATAL,
/**
* This generates only a warning message. Should be ignored, but however
* is included.
*/
SL_ERROR_CLASS_WARNING
} sl_error_class;
__BEGIN_DECLS
/**
* Throws an error condition. It's used heavly by this libraries because
* assuse an high grade of flexiblity. The class variable means the
* function behaviour, whereas, the error variable means the error type.
* It can prints also custom error messages, if error variable is equal to
* SL_ERROR_CUSTOM.
*/
void sl_error_throw (sl_error_class __class, sl_error __error, const char *__fmt,
...);
__END_DECLS
#endif /* _sl_error_h_ */
syntax highlighted by Code2HTML, v. 0.9.1