Main Page   Compound List   File List   Compound Members   File Members  

lib/gobj/errormgr.h File Reference

Error manager header. More...

#include <gobjconfig.h>
#include <gobj/context.h>
#include <gobj/error.h>
#include <gobj/decls.h>
#include <stdio.h>

Defines

#define Gj_exit(str)    gj_exit(__FILE__, __LINE__, (str), 0)
 Exit the program. More...

#define Gj_exitStr(str, str2)    gj_exit(__FILE__, __LINE__, (str), (str2))
 Exit the program. More...

#define GJ_ERR_THROW(id, rest...)    Gj_errormgr_addError(ctx, Gj_error_new(& id, __FILE__, __LINE__, ## rest))
 Throw error macro.

#define GJ_ERR_CLEAR()    Gj_errormgr_clear(ctx)
 Clear the error chain.

#define GJ_ERR_OCCURED()    Gj_errormgr_errOccured(ctx)
 Test if an error has occured.

#define GJ_ERR_FATAL()    Gj_errormgr_isFatal(ctx)
 Test if the error is fatal.


Functions

void gj_exit (char* module, int line, char* str, char* str2)
 Exit the program. More...

Gj_ErrormgrGj_errormgr_new (Gj_Ctx* ctx)
 Create a new error manager. More...

Gj_ErrormgrGj_errormgr_createInitial ()
 Create a initial error manager. More...

void Gj_errormgr_delete (Gj_Ctx* ctx)
 Destroy the error manager.

void Gj_errormgr_addError (Gj_Ctx* ctx, Gj_Error* err)
 Add an error to the error chain.

void Gj_errormgr_clear (Gj_Ctx* ctx)
 Clear the error chain.

void Gj_errormgr_createError (Gj_Ctx* ctx)
 Make sure that there IS an error in the error chain (create one if needed).

Gj_Bool Gj_errormgr_errOccured (Gj_Ctx* ctx)
 Test if an error has occured.

Gj_Bool Gj_errormgr_isFatal (Gj_Ctx* ctx)
 Test if the error is fatal.

Gj_ErrorGj_errormgr_nextError (Gj_Ctx* ctx, Gj_Error* error)
 Get the next element of the error walkthrough. More...

void Gj_errormgr_dump (Gj_Ctx* ctx, FILE* stream)
 Print out an error backtrace to the given stream.


Detailed Description

Error manager header.

See also:
system.h , persona.h , session.h


Define Documentation

#define Gj_exit( str )   gj_exit(__FILE__, __LINE__, (str), 0)
 

Exit the program.

Parameters:
str   A string to print out.

Only used for absolutely fatal errors.

#define Gj_exitStr( str, str2 )   gj_exit(__FILE__, __LINE__, (str), (str2))
 

Exit the program.

Parameters:
str   A string to print out.
str2   A second string to print out.

Only used for absolutely fatal errors.


Function Documentation

void gj_exit ( char * module,
int line,
char * str,
char * str2 )
 

Exit the program.

For internal use only.

Gj_Errormgr * Gj_errormgr_new ( Gj_Ctx * ctx )
 

Create a new error manager.

Returns:
The pointer to the new error manager on success, 0 otherwise.

Gj_Errormgr * Gj_errormgr_createInitial ( )
 

Create a initial error manager.

This function should only be used if there is no usable context available.

Returns:
The pointer to the new error manager on success, 0 otherwise.

Gj_Error * Gj_errormgr_nextError ( Gj_Ctx * ctx,
Gj_Error * error )
 

Get the next element of the error walkthrough.

If error is 0, the first element is returned. To get the next element, error should be the result of the last call. The returned error is STILL OWNED by the errormgr. A null pointer is returned if the last element of was already reached. The last error is returned first.


Generated at Fri Aug 17 18:28:56 2001 for Gobj by doxygen1.2.1 written by Dimitri van Heesch, © 1997-2000