GEL  0.99
Error Management

Macros

#define GEL_ESUCCESS   0
 
#define GEL_EIO   2
 
#define GEL_EFORMAT   4
 
#define GEL_ENOTSUPP   6
 
#define GEL_ENOTFOUND   8
 
#define GEL_ENOTLOADED   10
 
#define GEL_EDEPEND   16
 
#define GEL_WDYNAMIC   1
 
#define GEL_WNONFATAL   3
 
#define GEL_IS_WARNING   (gel_errno & 1)
 
#define GEL_IS_ERROR   (!(gel_errno & 1))
 
#define GEL_ERRNO   (gel_errno >> 1)
 

Functions

const char * gel_strerror (void)
 

Variables

int gel_errno = GEL_ESUCCESS
 

Detailed Description

GEL provides a standard way of error management:

Macro Definition Documentation

◆ GEL_EDEPEND

#define GEL_EDEPEND   16

Dependency problem.

◆ GEL_EFORMAT

#define GEL_EFORMAT   4

Error in ELF file format.

◆ GEL_EIO

#define GEL_EIO   2

Error inf input / ouput.

◆ GEL_ENOTFOUND

#define GEL_ENOTFOUND   8

File, symbol, section not found.

◆ GEL_ENOTLOADED

#define GEL_ENOTLOADED   10

Data not already loaded.

◆ GEL_ENOTSUPP

#define GEL_ENOTSUPP   6

Unsupported ELF feature.

◆ GEL_ERRNO

#define GEL_ERRNO   (gel_errno >> 1)

Get the gel_errno with warning bit removed.

◆ GEL_ESUCCESS

#define GEL_ESUCCESS   0

Last operation has been successful.

Index out of bounds.

Not enough ressources (usually memory).

◆ GEL_IS_ERROR

#define GEL_IS_ERROR   (!(gel_errno & 1))

Test if gel_errno contains an error.

Returns
True if there is an error.

◆ GEL_IS_WARNING

#define GEL_IS_WARNING   (gel_errno & 1)

Test if gel_errno contains a warning.

Returns
True if there is a warning.

◆ GEL_WDYNAMIC

#define GEL_WDYNAMIC   1

Dynamic problem.

◆ GEL_WNONFATAL

#define GEL_WNONFATAL   3

Non-fatal problem.

Function Documentation

◆ gel_strerror()

const char* gel_strerror ( void  )

Get the message associated with the current gel_errno.

Returns
Error message.

Variable Documentation

◆ gel_errno

int gel_errno = GEL_ESUCCESS

Usually, the GEL functions shows an error by returning a -1 value or a NULL pointer. More details about the error may be found in this variable.

This variable contains one of definitions GEL_Exxx or GEL_Wxxx.