Nilorea Library
C utilities for networking, threading, graphics
n_exceptions.h File Reference

Exception management for C. More...

#include <stdio.h>
#include <stdlib.h>
#include <setjmp.h>
+ Include dependency graph for n_exceptions.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ExceptionContextList
 Exception stack structure. More...
 

Macros

#define ARRAY_EXCEPTION   2
 Possibly Throwed value, we checked an out of bound operation. More...
 
#define Catch(X)
 Macro for replacing catch. More...
 
#define CatchAll()
 Macro for replacing catch. More...
 
#define DIVZERO_EXCEPTION   4
 Possibly Throwed value, we check a divide by zero operation. More...
 
#define EndTry
 Macro helper for closing the try-catch block. More...
 
#define GENERAL_EXCEPTION   ARRAY_EXCEPTION|DIVZERO_EXCEPTION|OVERFLOW_EXCEPTION|PARSING_EXCEPTION
 General exception, we just detected an error an decided to go back where we're safe. More...
 
#define NO_EXCEPTION   0
 Possibly Throwed value, everything is fine. More...
 
#define OVERFLOW_EXCEPTION   8
 Possibly Throwed value, we checked an overflow in our arrays. More...
 
#define PARSING_EXCEPTION   16
 Possibly Throwed value, we checked an error during a char * parsing. More...
 
#define Throw(X)
 Macro helper for adding exception throwing in custom functions. More...
 
#define Try
 Macro for replacing try. More...
 

Functions

void pop_exception (int)
 Function to pop an exception in the list. More...
 
void push_exception (void)
 Function to push an exception in the list. More...
 

Variables

ExceptionContextList__Exceptions
 Globale variable for exception stack management. More...
 

Detailed Description

Exception management for C.

Author
Castagnier Mickael
Version
1.0
Date
20/11/09

Definition in file n_exceptions.h.