GMime Library Reference Manual | |||
---|---|---|---|
<<< Previous Page | Home | Up | Next Page >>> |
enum ExceptionId; struct GMimeException; GMimeException* g_mime_exception_new (void); void g_mime_exception_init (GMimeException *ex); void g_mime_exception_clear (GMimeException *exception); void g_mime_exception_set (GMimeException *ex, ExceptionId id, const char *desc); void g_mime_exception_setv (GMimeException *ex, ExceptionId id, const char *format, ...); ExceptionId g_mime_exception_get_id (GMimeException *ex); const char* g_mime_exception_get_description (GMimeException *ex); #define g_mime_exception_is_set (ex) void g_mime_exception_xfer (GMimeException *ex_dst, GMimeException *ex_src); void g_mime_exception_free (GMimeException *exception); |
struct GMimeException { /* do not access the fields directly */ ExceptionId id; char *desc; }; |
GMimeException* g_mime_exception_new (void); |
Create and returns a new exception object.
void g_mime_exception_init (GMimeException *ex); |
Init an exception. This routine is mainly useful when using a statically allocated exception.
void g_mime_exception_clear (GMimeException *exception); |
Clear an exception, that is, set the exception ID to GMIME_EXCEPTION_NONE and free the description text. If the exception is NULL, this funtion just returns.
void g_mime_exception_set (GMimeException *ex, ExceptionId id, const char *desc); |
Set the value of an exception. The exception id is a unique number representing the exception. The textual description is a small text explaining what happened and provoked the exception.
When ex is NULL, nothing is done, this routine simply returns.
void g_mime_exception_setv (GMimeException *ex, ExceptionId id, const char *format, ...); |
Set the value of an exception. The exception id is a unique number representing the exception. The textual description is a small text explaining what happened and provoked the exception. In this version, the string is created from the format string and the variable argument list.
It is safe to say: g_mime_exception_setv (ex, ..., g_mime_exception_get_description (ex), ...);
When ex is NULL, nothing is done, this routine simply returns.
ExceptionId g_mime_exception_get_id (GMimeException *ex); |
Return the id of an exception. If ex is NULL, return GMIME_EXCEPTION_NONE;
const char* g_mime_exception_get_description (GMimeException *ex); |
Return the exception description text. If ex is NULL, return NULL;
void g_mime_exception_xfer (GMimeException *ex_dst, GMimeException *ex_src); |
Transfer the content of an exception from an exception object to another. The destination exception receives the id and the description text of the source exception.
void g_mime_exception_free (GMimeException *exception); |
Free an exception object. If the exception is NULL, nothing is done, the routine simply returns.