Back to index

lightning-sunbird  0.9+nobinonly
Classes | Functions | Variables
icalerror.c File Reference
#include <stdlib.h>
#include <string.h>
#include "icalerror.h"

Go to the source code of this file.

Classes

struct  icalerror_state
struct  icalerror_string_map

Functions

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

Variables

static icalerrorenum icalerrno_storage = ICAL_NO_ERROR
static int foo
int icalerror_errors_are_fatal = 0
 If true, libicl aborts after a call to icalerror_set_error.
static struct icalerror_state []
static struct icalerror_string_map []

Class Documentation

struct icalerror_state

Definition at line 117 of file icalerror.c.

Class Members
icalerrorenum error
icalerrorstate state
struct icalerror_string_map

Definition at line 138 of file icalerror.c.

Class Members
icalerrorenum error
char name
const char * str

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 160 of file icalerror.c.

                                                          {
 
    icalerrorenum e;
    int i = 0;

    for( i = 0; string_map[i].error != ICAL_NO_ERROR; i++){
        if (strcmp(string_map[i].str,str) == 0){
            e = string_map[i].error;
        }
    }

    return e;
}

Here is the caller graph for this function:

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;     
}

Here is the caller graph for this function:

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;     
       }
    }
}

Here is the caller graph for this function:

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*/
    
}

Here is the caller graph for this function:

Definition at line 174 of file icalerror.c.

Here is the call graph for this function:


Variable Documentation

int foo [static]

Definition at line 77 of file icalerror.c.

Definition at line 68 of file icalerror.c.

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.

struct icalerror_state[] [static]
struct icalerror_string_map[] [static]
Initial value:
 
{
    {"BADARG",ICAL_BADARG_ERROR,"BADARG: Bad argument to function"},
    { "NEWFAILED",ICAL_NEWFAILED_ERROR,"NEWFAILED: Failed to create a new object via a *_new() routine"},
    { "ALLOCATION",ICAL_ALLOCATION_ERROR,"ALLOCATION: Failed to allocate new memory"},
    {"MALFORMEDDATA",ICAL_MALFORMEDDATA_ERROR,"MALFORMEDDATA: An input string was not correctly formed or a component has missing or extra properties"},
    { "PARSE",ICAL_PARSE_ERROR,"PARSE: Failed to parse a part of an iCal component"},
    {"INTERNAL",ICAL_INTERNAL_ERROR,"INTERNAL: Random internal error. This indicates an error in the library code, not an error in use"}, 
    { "FILE",ICAL_FILE_ERROR,"FILE: An operation on a file failed. Check errno for more detail."},
    { "USAGE",ICAL_USAGE_ERROR,"USAGE: Failed to propertyl sequence calls to a set of interfaces"},
    { "UNIMPLEMENTED",ICAL_UNIMPLEMENTED_ERROR,"UNIMPLEMENTED: This feature has not been implemented"},
    { "NO",ICAL_NO_ERROR,"NO: No error"},
    {"UNKNOWN",ICAL_UNKNOWN_ERROR,"UNKNOWN: Unknown error type -- icalerror_strerror() was probably given bad input"}
}

Definition at line 144 of file icalerror.c.