# C Exception #
CException is a C error handling system utilizing TRY CATCH and FINALLY
CException allows you to simulate TRY, CATCH, FINALLY and THROW from higher level
languages such as C++ and Java in your C code. It even allows for a protected runtime
environment that will "catch" un-caught exceptions. See main.c for example code, and
cexception.h for detailed implementation information. However, to use ALL the features of this
you must be using gcc and elf.
Compiling the example:
## Requirements ##
1. It requires scons (http://www.scons.org) and GCC (GNU C Dependencies)
* If you're on Ubuntu just do sudo apt-get install scons
2. GCC and ELF (Sorry windoze and mac)
## Building ##
You can either build with the included scons script, or just drop the header file into
an existing project.
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
gcc -o main.o -c main.c
gcc -o go main.o
scons: done building targets.
## Running the example: ##
Caught exception 1
Error 2 -- Error Number Out of Range in file: main.c in function: foo on line 7
Finally 1 executing
Finally 2 executing, error went un-handled
Caught exception 3
Error 1 -- Illegal Argument in file: main.c in function: cexception_start on line 42
Caught exception 4
Error 3 -- Null Pointer in file: main.c in function: cexception_start on line 47
Caught exception 5: 3
Error 3 -- Null Pointer in file: main.c in function: cexception_start on line 62
PANIC -- Uncaught Exception
Error 4 -- Barn Fire in file: main.c in function: cexception_start on line 74