libkcal

icalerror.h File Reference

#include <assert.h>
#include <stdio.h>

Include dependency graph for icalerror.h:

Go to the source code of this file.


Defines

#define ICAL_SETERROR_ISFUNC
#define icalerrno   (*(icalerrno_return()))
#define icalerror_assert(test, message)
#define icalerror_check_arg(test, arg)   if(!(test)) { icalerror_set_errno(ICAL_BADARG_ERROR); }
#define icalerror_check_arg_re(test, arg, error)   if(!(test)) { icalerror_stop_here(); assert(0); return error;}
#define icalerror_check_arg_rv(test, arg)   if(!(test)) {icalerror_set_errno(ICAL_BADARG_ERROR); return; }
#define icalerror_check_arg_rx(test, arg, x)   if(!(test)) { icalerror_set_errno(ICAL_BADARG_ERROR); return x;}
#define icalerror_check_arg_rz(test, arg)   if(!(test)) { icalerror_set_errno(ICAL_BADARG_ERROR); return 0;}
#define icalerror_check_component_type(value, type)   ;
#define icalerror_check_parameter_type(value, type)   ;
#define icalerror_check_property_type(value, type)   ;
#define icalerror_check_value_type(value, type)   ;
#define icalerror_warn(message)   {fprintf(stderr,"%s:%d: %s\n",__FILE__,__LINE__,message);}

Enumerations

enum  icalerrorenum {
  ICAL_NO_ERROR, ICAL_BADARG_ERROR, ICAL_NEWFAILED_ERROR, ICAL_ALLOCATION_ERROR,
  ICAL_MALFORMEDDATA_ERROR, ICAL_PARSE_ERROR, ICAL_INTERNAL_ERROR, ICAL_FILE_ERROR,
  ICAL_USAGE_ERROR, ICAL_UNIMPLEMENTED_ERROR, ICAL_UNKNOWN_ERROR
}
enum  icalerrorstate { ICAL_ERROR_FATAL, ICAL_ERROR_NONFATAL, ICAL_ERROR_DEFAULT, ICAL_ERROR_UNKNOWN }

Functions

void _icalerror_set_errno (icalerrorenum)
icalerrorenumicalerrno_return (void)
void icalerror_clear_errno (void)
void icalerror_crash_here (void)
icalerrorstate icalerror_get_error_state (icalerrorenum error)
char * icalerror_perror ()
void icalerror_restore (const char *error, icalerrorstate es)
void icalerror_set_errno (icalerrorenum x)
void icalerror_set_error_state (icalerrorenum error, icalerrorstate)
void icalerror_stop_here (void)
char * icalerror_strerror (icalerrorenum e)
icalerrorstate icalerror_supress (const char *error)

Variables

int icalerror_errors_are_fatal

Define Documentation

#define ICAL_SETERROR_ISFUNC

Definition at line 38 of file icalerror.h.

#define icalerrno   (*(icalerrno_return()))

Definition at line 64 of file icalerror.h.

#define icalerror_assert ( test,
message   ) 

Definition at line 130 of file icalerror.h.

#define icalerror_check_arg ( test,
arg   )     if(!(test)) { icalerror_set_errno(ICAL_BADARG_ERROR); }

Definition at line 134 of file icalerror.h.

#define icalerror_check_arg_re ( test,
arg,
error   )     if(!(test)) { icalerror_stop_here(); assert(0); return error;}

Definition at line 143 of file icalerror.h.

#define icalerror_check_arg_rv ( test,
arg   )     if(!(test)) {icalerror_set_errno(ICAL_BADARG_ERROR); return; }

Definition at line 137 of file icalerror.h.

#define icalerror_check_arg_rx ( test,
arg,
 )     if(!(test)) { icalerror_set_errno(ICAL_BADARG_ERROR); return x;}

Definition at line 146 of file icalerror.h.

#define icalerror_check_arg_rz ( test,
arg   )     if(!(test)) { icalerror_set_errno(ICAL_BADARG_ERROR); return 0;}

Definition at line 140 of file icalerror.h.

#define icalerror_check_component_type ( value,
type   )     ;

Definition at line 118 of file icalerror.h.

#define icalerror_check_parameter_type ( value,
type   )     ;

Definition at line 117 of file icalerror.h.

#define icalerror_check_property_type ( value,
type   )     ;

Definition at line 116 of file icalerror.h.

#define icalerror_check_value_type ( value,
type   )     ;

Definition at line 115 of file icalerror.h.

#define icalerror_warn ( message   )     {fprintf(stderr,"%s:%d: %s\n",__FILE__,__LINE__,message);}

Definition at line 78 of file icalerror.h.


Enumeration Type Documentation

Enumerator:
ICAL_NO_ERROR 
ICAL_BADARG_ERROR 
ICAL_NEWFAILED_ERROR 
ICAL_ALLOCATION_ERROR 
ICAL_MALFORMEDDATA_ERROR 
ICAL_PARSE_ERROR 
ICAL_INTERNAL_ERROR 
ICAL_FILE_ERROR 
ICAL_USAGE_ERROR 
ICAL_UNIMPLEMENTED_ERROR 
ICAL_UNKNOWN_ERROR 

Definition at line 48 of file icalerror.h.

Enumerator:
ICAL_ERROR_FATAL 
ICAL_ERROR_NONFATAL 
ICAL_ERROR_DEFAULT 
ICAL_ERROR_UNKNOWN 

Definition at line 86 of file icalerror.h.


Function Documentation

void _icalerror_set_errno ( icalerrorenum   ) 

icalerrorenum* icalerrno_return ( void   ) 

void icalerror_clear_errno ( void   ) 

void icalerror_crash_here ( void   ) 

icalerrorstate icalerror_get_error_state ( icalerrorenum  error  ) 

char* icalerror_perror (  ) 

void icalerror_restore ( const char *  error,
icalerrorstate  es 
)

void icalerror_set_errno ( icalerrorenum  x  ) 

void icalerror_set_error_state ( icalerrorenum  error,
icalerrorstate   
)

void icalerror_stop_here ( void   ) 

This routine is called before any error is triggered.

It is called by icalerror_set_errno, so it does not appear in all of the macros below

char* icalerror_strerror ( icalerrorenum  e  ) 

icalerrorstate icalerror_supress ( const char *  error  ) 


Variable Documentation

If true, libicl aborts after a call to icalerror_set_error.

Warning:
NOT THREAD SAFE -- recommended that you do not change this in a multithreaded program.