except.c File Reference

Source for Exception Handling Library (CBL). More...

#include <stddef.h>
#include <setjmp.h>
#include <stdio.h>
#include <stdlib.h>
#include "cbl/assert.h"
#include "except.h"

Include dependency graph for except.c:


Functions

void() except_raise (const except_t *e, const char *file, int line)
 raises an exception and set its information properly.

Variables

except_frame_t * except_stack = NULL
 stack for handling nested exceptions.

Detailed Description

Source for Exception Handling Library (CBL).


Function Documentation

void() except_raise ( const except_t *  e,
const char *  file,
int  line 
)

raises an exception and set its information properly.

EXCEPT_RAISE and EXCEPT_RERAISE macros call except_raise() with __FILE__ and __LINE__ predefined macros (and __func__ if C99 supported) for the file and line parameters. So in general there is little chance to call except_raise() directly in application code.

Possible exceptions: assert_exceptfail

Unchecked errors: foreign data structure given for e

Parameters:
[in] e exception to raise
[in] file file name where exception occurred
[in] func function name where exception occurred (if C99 supported)
[in] line line number where exception occurred
Returns:
except_raise() cannot return anything
Todo:
Improvements are possible and planned:
  • it would be useful to show stack traces when an uncaught exception leads to abortion of a program. The stack traces should include as much information as possible, for example, names of caller functions, calling sites (file name, function name and line number) and arguments.


Generated on Mon Jan 24 01:12:36 2011 for The Exception Handling Library by  doxygen 1.5.8