camel-imapp-exception
3
CAMEL Library

# camel-imapp-exception

## Synopsis

    struct              CamelExceptionEnv;
    #define             CAMEL_TRY
    #define             CAMEL_IGNORE
    #define             CAMEL_CATCH                         (x)
    #define             CAMEL_DONE
    #define             CAMEL_DROP                          ()
    void                camel_exception_setup               (void);
    void                camel_exception_try                 (struct _CamelExceptionEnv *env);
    void                camel_exception_done                (struct _CamelExceptionEnv *env);
    void                camel_exception_drop                (struct _CamelExceptionEnv *env);
    void                camel_exception_throw_ex            (CamelException *ex);
    void                camel_exception_throw               (int id,
                                                             char *fmt,
                                                             ...);

## Description

## Details

### struct CamelExceptionEnv

    struct CamelExceptionEnv {
    	struct _CamelExceptionEnv *parent;
    	CamelException *ex;
    	jmp_buf env;
    };

### CAMEL_TRY

    #define CAMEL_TRY { struct _CamelExceptionEnv __env; camel_exception_try(&__env); if (setjmp(__env.env) == 0)

### CAMEL_IGNORE

    #define CAMEL_IGNORE camel_exception_done(&__env); }

### CAMEL_CATCH()

    #define CAMEL_CATCH(x) { CamelException *x; x=__env.ex; if (x != NULL)

`x` :

### CAMEL_DONE

    #define CAMEL_DONE } camel_exception_done(&__env); }

### CAMEL_DROP()

    #define CAMEL_DROP() camel_exception_drop(&__env)

### camel_exception_setup ()

    void                camel_exception_setup               (void);

### camel_exception_try ()

    void                camel_exception_try                 (struct _CamelExceptionEnv *env);

`env` :

### camel_exception_done ()

    void                camel_exception_done                (struct _CamelExceptionEnv *env);

`env` :

### camel_exception_drop ()

    void                camel_exception_drop                (struct _CamelExceptionEnv *env);

`env` :

### camel_exception_throw_ex ()

    void                camel_exception_throw_ex            (CamelException *ex);

`ex` :

### camel_exception_throw ()

    void                camel_exception_throw               (int id,
                                                             char *fmt,
                                                             ...);

`id` :

`fmt` :

`...` :