Main Page   Compound List   File List   Compound Members   File Members  

lib/gobj/error.h File Reference

Error handling function header. More...

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

Go to the source code of this file.

Compounds

struct  Gj_Errorargtype_struct
struct  Gj_Errorspec_struct
struct  Gj_Error_struct

Defines

#define GJ_ERRORARGTYPE_NAMELEN   20
 Maximal argtype length.

#define GJ_ERRORSPEC_ARGLEN   100
 Maximal length of the argument description of an error.

#define GJ_ERRORSPEC_MSGLEN   300
 Maximal length of the message description of an error.


Typedefs

typedef char* Gj_ErrorConvertFunc (void*)
 Argument to string conversion function type. More...

typedef enum Gj_Errordatatype_enum  Gj_Errordatatype
 Error data type enum.

typedef struct Gj_Errorargtype_struct  Gj_Errorargtype
 Argtype structure.

typedef struct Gj_Errorspec_struct  Gj_Errorspec
 Errorspec structure.


Enumerations

enum  Gj_Errordatatype_enum {
  GJ_ERRDATATYPE_STRING,
  GJ_ERRDATATYPE_POINTER,
  GJ_ERRDATATYPE_INT,
  GJ_ERRDATATYPE_DOUBLE,
  GJ_ERRDATATYPE_DATA
}
 Error data type enum.


Functions

Gj_ErrorGj_error_new (Gj_Id* id, char* module, int line, ...)
 Create a new error. More...

void Gj_error_delete (Gj_Error* error)
 Destroy an error. More...

char* Gj_error_getSourcefile (Gj_Error* error)
 Get the name of the source file where the error occured. More...

int Gj_error_getSourceline (Gj_Error* error)
 Get the source line where the error occured. More...

char* Gj_error_getMsg (Gj_Error* error)
 Get the error message of a given error. More...

void Gj_error_dump (Gj_Error* error, FILE* stream)
 Dump an error structure to the given stream. More...


Detailed Description

Error handling function header.


Typedef Documentation

typedef char* Gj_ErrorConvertFunc(void*)
 

Argument to string conversion function type.

The returned string should be allocated via Gj_alloc().


Function Documentation

Gj_Error * Gj_error_new ( Gj_Id * id,
char * module,
int line,
... )
 

Create a new error.

Parameters:
id   The error id.
module   The module name.
line   The source file line number.
...   Additional error informations.
Returns:
A pointer to the new created error.

void Gj_error_delete ( Gj_Error * error )
 

Destroy an error.

Parameters:
error   A pointer to the error.

char * Gj_error_getSourcefile ( Gj_Error * error )
 

Get the name of the source file where the error occured.

Parameters:
error   A pointer to the error.
Returns:
The source file name.

int Gj_error_getSourceline ( Gj_Error * error )
 

Get the source line where the error occured.

Parameters:
error   A pointer to the error.
Returns:
The source line number.

char * Gj_error_getMsg ( Gj_Error * error )
 

Get the error message of a given error.

Parameters:
error   A pointer to the error.
Returns:
The error message (NOT OWNED by the error).

void Gj_error_dump ( Gj_Error * error,
FILE * stream )
 

Dump an error structure to the given stream.

Parameters:
error   A pointer to the error.
stream   A pointer to the output stream.


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