gmime-exception

Name

gmime-exception -- 

Synopsis



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);

Description

Details

enum ExceptionId

typedef enum {
#include <gmime/gmime-exception-list.def>
} ExceptionId;


struct GMimeException

struct GMimeException {
	/* do not access the fields directly */
	ExceptionId id;
	char *desc;
};


g_mime_exception_new ()

GMimeException* g_mime_exception_new        (void);

Create and returns a new exception object.

Returns :the newly allocated exception object.


g_mime_exception_init ()

void        g_mime_exception_init           (GMimeException *ex);

Init an exception. This routine is mainly useful when using a statically allocated exception.

ex : exception


g_mime_exception_clear ()

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.

exception : the exception object


g_mime_exception_set ()

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.

ex : exception object
id : exception id
desc : textual description of the exception


g_mime_exception_setv ()

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.

ex : exception object
id : exception id
format : format of the description string. The format string is used as in printf().
... : arguments


g_mime_exception_get_id ()

ExceptionId g_mime_exception_get_id         (GMimeException *ex);

Return the id of an exception. If ex is NULL, return GMIME_EXCEPTION_NONE;

ex : The exception object
Returns : Exception ID.


g_mime_exception_get_description ()

const char* g_mime_exception_get_description
                                            (GMimeException *ex);

Return the exception description text. If ex is NULL, return NULL;

ex : The exception object
Returns : Exception description text.


g_mime_exception_is_set()

#define     g_mime_exception_is_set(ex)

ex : 


g_mime_exception_xfer ()

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.

ex_dst : Destination exception object
ex_src : Source exception object


g_mime_exception_free ()

void        g_mime_exception_free           (GMimeException *exception);

Free an exception object. If the exception is NULL, nothing is done, the routine simply returns.

exception : The exception object to free