exception.h revision 7e7bd3dccbfe8f79e25e5c1554b5bc3a9aaca321
/*
libparted - a library for manipulating disk partitions
Copyright (C) 1999, 2000, 2007 Free Software Foundation, Inc.
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* \addtogroup PedException
* @{
*/
/** \file exception.h */
#ifndef PED_EXCEPTION_H_INCLUDED
#define PED_EXCEPTION_H_INCLUDED
typedef struct _PedException PedException;
/**
* Exception type
*/
enum _PedExceptionType {
};
typedef enum _PedExceptionType PedExceptionType;
/**
* Option for resolving the exception
*/
enum _PedExceptionOption {
};
typedef enum _PedExceptionOption PedExceptionOption;
#define PED_EXCEPTION_YES_NO_CANCEL (PED_EXCEPTION_YES_NO \
#define PED_EXCEPTION_IGNORE_CANCEL (PED_EXCEPTION_IGNORE \
/**
* Structure with information about exception
*/
struct _PedException {
char* message; /**< text describing what the event was */
the exception handler can
return (the ways an exception
can be resolved) */
};
extern int ped_exception; /* set to true if there's an exception */
extern PedExceptionHandler *ped_exception_get_handler(void);
const char* message,
...);
/* rethrows an exception - i.e. calls the exception handler, (or returns a
code to return to pass up higher) */
extern PedExceptionOption ped_exception_rethrow ();
/* frees an exception, indicating that the exception has been handled.
Calling an exception handler counts. */
extern void ped_exception_catch ();
/* indicate that exceptions should not go to the exception handler, but passed
up to the calling function(s) */
extern void ped_exception_fetch_all ();
/* indicate that exceptions should invoke the exception handler */
extern void ped_exception_leave_all ();
#endif /* PED_EXCEPTION_H_INCLUDED */
/** @} */