Back to index

lightning-sunbird  0.9+nobinonly
Defines | Typedefs | Enumerations | Functions | Variables
icalerror.h File Reference
#include <assert.h>
#include <stdio.h>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

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

Typedefs

typedef enum icalerrorenum icalerrorenum
typedef enum icalerrorstate icalerrorstate

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, 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,
  ICAL_ERROR_FATAL, ICAL_ERROR_NONFATAL, ICAL_ERROR_DEFAULT, ICAL_ERROR_UNKNOWN
}

Functions

void icalerror_stop_here (void)
 This routine is called before any error is triggered.
void icalerror_crash_here (void)
icalerrorenumicalerrno_return (void)
void icalerror_clear_errno (void)
void _icalerror_set_errno (icalerrorenum)
char * icalerror_strerror (icalerrorenum e)
char * icalerror_perror ()
void icalerror_set_error_state (icalerrorenum error, icalerrorstate)
icalerrorstate icalerror_get_error_state (icalerrorenum error)
void icalerror_set_errno (icalerrorenum x)
icalerrorstate icalerror_supress (const char *error)
void icalerror_restore (const char *error, icalerrorstate es)

Variables

int icalerror_errors_are_fatal
 If true, libicl aborts after a call to icalerror_set_error.

Define Documentation

Definition at line 38 of file icalerror.h.

Definition at line 64 of file icalerror.h.

Definition at line 130 of file icalerror.h.

Definition at line 134 of file icalerror.h.

Definition at line 143 of file icalerror.h.

Definition at line 137 of file icalerror.h.

Definition at line 146 of file icalerror.h.

Definition at line 140 of file icalerror.h.

Definition at line 118 of file icalerror.h.

Definition at line 117 of file icalerror.h.

Definition at line 116 of file icalerror.h.

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.


Typedef Documentation


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 
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.

                           {
    ICAL_NO_ERROR,     /* icalerrno may not be initialized - put it first so and pray that the compiler initialize things to zero */    
    ICAL_BADARG_ERROR,
    ICAL_NEWFAILED_ERROR,
    ICAL_ALLOCATION_ERROR,
    ICAL_MALFORMEDDATA_ERROR, 
    ICAL_PARSE_ERROR,
    ICAL_INTERNAL_ERROR, /* Like assert --internal consist. prob */
    ICAL_FILE_ERROR,
    ICAL_USAGE_ERROR,
    ICAL_UNIMPLEMENTED_ERROR,
    ICAL_UNKNOWN_ERROR  /* Used for problems in input to icalerror_strerror()*/

} icalerrorenum;
Enumerator:
ICAL_ERROR_FATAL 
ICAL_ERROR_NONFATAL 
ICAL_ERROR_DEFAULT 
ICAL_ERROR_UNKNOWN 
ICAL_ERROR_FATAL 
ICAL_ERROR_NONFATAL 
ICAL_ERROR_DEFAULT 
ICAL_ERROR_UNKNOWN 

Definition at line 86 of file icalerror.h.

                            { 
    ICAL_ERROR_FATAL,     /* Not fata */
    ICAL_ERROR_NONFATAL,  /* Fatal */
    ICAL_ERROR_DEFAULT,   /* Use the value of icalerror_errors_are_fatal*/
    ICAL_ERROR_UNKNOWN    /* Asked state for an unknown error type */
} icalerrorstate ;

Function Documentation

Definition at line 70 of file icalerror.c.

                                      {
   return &icalerrno_storage;
}

Definition at line 106 of file icalerror.c.

Definition at line 84 of file icalerror.c.

{
    int *p=0;
    *p = 1;

    assert( *p);
}

Definition at line 220 of file icalerror.c.

{
    int i;

    for(i = 0; error_state_map[i].error!= ICAL_NO_ERROR;i++){
       if(error_state_map[i].error == error){
           return error_state_map[i].state;      
       }
    }

    return ICAL_ERROR_UNKNOWN;     
}
char* icalerror_perror ( )

Definition at line 190 of file icalerror.c.

Here is the call graph for this function:

void icalerror_restore ( const char *  error,
icalerrorstate  es 
)

Definition at line 195 of file icalerror.c.

Here is the call graph for this function:

Definition at line 93 of file icalerror.c.

Here is the call graph for this function:

Definition at line 208 of file icalerror.c.

{
    int i;

    for(i = 0; error_state_map[i].error!= ICAL_NO_ERROR;i++){
       if(error_state_map[i].error == error){
           error_state_map[i].state = state;     
       }
    }
}

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

Definition at line 79 of file icalerror.c.

{
    foo++; /* Keep optimizers from removing routine */
}

Definition at line 236 of file icalerror.c.

                                          {

    int i;

    for (i=0; string_map[i].error != ICAL_UNKNOWN_ERROR; i++) {
       if (string_map[i].error == e) {
           return string_map[i].name;
       }
    }

    return string_map[i].name; /* Return string for ICAL_UNKNOWN_ERROR*/
    
}

Definition at line 174 of file icalerror.c.

Here is the call graph for this function:


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.

Definition at line 114 of file icalerror.c.