Main Page   Compound List   File List   Compound Members   File Members  

errors.c File Reference

#include <stdio.h>
#include <stdlib.h>
#include "arithmetique.h"

Go to the source code of this file.

Compounds

struct  linear_exception_holder

Defines

#define FALSE   0
#define TRUE   1
#define MAX_STACKED_CONTEXTS   64
#define exception_debug_message(type)
#define exception_debug_trace(type)   if (linear_exception_debug_mode) { exception_debug_message(type); }
#define same_string_p(s1, s2)   (strcmp((s1),(s2))==0)

Typedefs

typedef int boolean

Functions

char * get_exception_name (unsigned int exception)
void set_exception_callbacks (exception_callback_t push, exception_callback_t pop)
void dump_exception_stack_to_file (FILE *f)
void dump_exception_stack ()
jmp_buf * push_exception_on_stack (int what, char *function, char *file, int line)
void pop_exception_from_stack (int what, char *function, char *file, int line)
void throw_exception (int what, const char *function, const char *file, int line)
void linear_initialize_exception_stack (unsigned int verbose_exceptions, exception_callback_t push, exception_callback_t pop)

Variables

unsigned int overflow_error = 1
unsigned int simplex_arithmetic_error = 2
unsigned int user_exception_error = 4
unsigned int parser_exception_error = 8
unsigned int timeout_error = 16
unsigned int any_exception_error = ~0
unsigned int the_last_just_thrown_exception = 0
int linear_exception_debug_mode = FALSE
unsigned int linear_exception_verbose = 1 | 2 | 16
linear_exception_holder exception_stack [MAX_STACKED_CONTEXTS]
int exception_index = 0
exception_callback_t push_callback = NULL
exception_callback_t pop_callback = NULL
int linear_number_of_exception_thrown = 0


Define Documentation

#define exception_debug_message type   
 

Value:

fprintf(stderr, "%s[%s:%d %s (%d)/%d]\n",                         \
            type, file, line, function, what, exception_index)

Definition at line 214 of file errors.c.

Referenced by pop_exception_from_stack(), push_exception_on_stack(), and throw_exception().

#define exception_debug_trace type       if (linear_exception_debug_mode) { exception_debug_message(type); }
 

Definition at line 218 of file errors.c.

Referenced by pop_exception_from_stack(), push_exception_on_stack(), and throw_exception().

#define FALSE   0
 

Definition at line 106 of file errors.c.

#define MAX_STACKED_CONTEXTS   64
 

Definition at line 163 of file errors.c.

Referenced by push_exception_on_stack().

#define same_string_p s1,
s2       (strcmp((s1),(s2))==0)
 

Definition at line 254 of file errors.c.

Referenced by pop_exception_from_stack().

#define TRUE   1
 

Definition at line 109 of file errors.c.


Typedef Documentation

typedef int boolean
 

Definition at line 103 of file errors.c.


Function Documentation

void dump_exception_stack void   
 

Definition at line 209 of file errors.c.

References dump_exception_stack_to_file().

void dump_exception_stack_to_file FILE *    f
 

Definition at line 192 of file errors.c.

References exception_index.

Referenced by dump_exception_stack().

char* get_exception_name unsigned int    exception
 

Definition at line 112 of file errors.c.

References any_exception_error, overflow_error, parser_exception_error, simplex_arithmetic_error, timeout_error, and user_exception_error.

void linear_initialize_exception_stack unsigned int    verbose_exceptions,
exception_callback_t    push,
exception_callback_t    pop
 

Definition at line 360 of file errors.c.

References linear_exception_verbose, and set_exception_callbacks().

void pop_exception_from_stack int    what,
char *    function,
char *    file,
int    line
 

Definition at line 261 of file errors.c.

References dump_exception_stack(), exception_debug_message, exception_debug_trace, exception_index, pop_callback, same_string_p, and the_last_just_thrown_exception.

jmp_buf* push_exception_on_stack int    what,
char *    function,
char *    file,
int    line
 

Definition at line 225 of file errors.c.

References dump_exception_stack(), exception_debug_message, exception_debug_trace, exception_index, MAX_STACKED_CONTEXTS, push_callback, and the_last_just_thrown_exception.

void set_exception_callbacks exception_callback_t    push,
exception_callback_t    pop
 

Definition at line 172 of file errors.c.

References pop_callback, and push_callback.

Referenced by linear_initialize_exception_stack().

void throw_exception int    what,
const char *    function,
const char *    file,
int    line
 

Definition at line 305 of file errors.c.

References dump_exception_stack(), exception_debug_message, exception_debug_trace, exception_index, linear_exception_verbose, linear_number_of_exception_thrown, pop_callback, the_last_just_thrown_exception, and linear_exception_holder::what.


Variable Documentation

unsigned int any_exception_error = ~0
 

Definition at line 92 of file errors.c.

Referenced by get_exception_name().

int exception_index = 0 [static]
 

Definition at line 165 of file errors.c.

Referenced by dump_exception_stack_to_file(), pop_exception_from_stack(), push_exception_on_stack(), and throw_exception().

linear_exception_holder exception_stack[MAX_STACKED_CONTEXTS] [static]
 

Definition at line 164 of file errors.c.

int linear_exception_debug_mode = FALSE [static]
 

Definition at line 136 of file errors.c.

unsigned int linear_exception_verbose = 1 | 2 | 16 [static]
 

Definition at line 137 of file errors.c.

Referenced by linear_initialize_exception_stack(), and throw_exception().

int linear_number_of_exception_thrown = 0
 

Definition at line 188 of file errors.c.

Referenced by throw_exception().

unsigned int overflow_error = 1
 

Definition at line 85 of file errors.c.

Referenced by get_exception_name().

unsigned int parser_exception_error = 8
 

Definition at line 88 of file errors.c.

Referenced by get_exception_name().

exception_callback_t pop_callback = NULL [static]
 

Definition at line 170 of file errors.c.

Referenced by pop_exception_from_stack(), set_exception_callbacks(), and throw_exception().

exception_callback_t push_callback = NULL [static]
 

Definition at line 169 of file errors.c.

Referenced by push_exception_on_stack(), and set_exception_callbacks().

unsigned int simplex_arithmetic_error = 2
 

Definition at line 86 of file errors.c.

Referenced by get_exception_name().

unsigned int the_last_just_thrown_exception = 0
 

Definition at line 132 of file errors.c.

Referenced by pop_exception_from_stack(), push_exception_on_stack(), and throw_exception().

unsigned int timeout_error = 16
 

Definition at line 89 of file errors.c.

Referenced by get_exception_name().

unsigned int user_exception_error = 4
 

Definition at line 87 of file errors.c.

Referenced by get_exception_name().


Generated on Mon Mar 15 10:59:52 2004 for polylib by doxygen1.2.18