views:

143

answers:

4

Hi -

I am rolling my own exception library for C and would like good examples to examine.

So far, I have been looking at David Hanson's: http://drhanson.net/work/

But I know I've seen other ones available in the past. Can you send me some additional pointers?

Thanks,

SetJmp

+1  A: 

Symbian implemented exceptions (called 'leaves') in terms of longjmp. This was C++ code, but translatable to C. There's a previous post about this.

Will
+3  A: 

Here is one, compatible with C89 and implementing the try/catch/finally schema as can be found in other OO languages.

philippe
A: 

Take a look at XXL: http://www.zork.org/xxl/

I found it quite usable in a previous project. Hasn't been updated in a while though.

Jason
A: 

CException is simple exception handling in C. It is significantly faster than full-blown C++ exception handling but loses some flexibility. It is portable to any platform supporting setjmp/longjmp.

philippe