Back to index

lightning-sunbird  0.9+nobinonly
Typedefs | Enumerations | Functions
icalrestriction.h File Reference
#include "icalproperty.h"
#include "icalcomponent.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef enum icalrestriction_kind icalrestriction_kind

Enumerations

enum  icalrestriction_kind {
  ICAL_RESTRICTION_NONE = 0, ICAL_RESTRICTION_ZERO, ICAL_RESTRICTION_ONE, ICAL_RESTRICTION_ZEROPLUS,
  ICAL_RESTRICTION_ONEPLUS, ICAL_RESTRICTION_ZEROORONE, ICAL_RESTRICTION_ONEEXCLUSIVE, ICAL_RESTRICTION_ONEMUTUAL,
  ICAL_RESTRICTION_UNKNOWN, ICAL_RESTRICTION_NONE = 0, ICAL_RESTRICTION_ZERO, ICAL_RESTRICTION_ONE,
  ICAL_RESTRICTION_ZEROPLUS, ICAL_RESTRICTION_ONEPLUS, ICAL_RESTRICTION_ZEROORONE, ICAL_RESTRICTION_ONEEXCLUSIVE,
  ICAL_RESTRICTION_ONEMUTUAL, ICAL_RESTRICTION_UNKNOWN
}

Functions

int icalrestriction_compare (icalrestriction_kind restr, int count)
int icalrestriction_is_parameter_allowed (icalproperty_kind property, icalparameter_kind parameter)
int icalrestriction_check (icalcomponent *comp)

Typedef Documentation


Enumeration Type Documentation

Enumerator:
ICAL_RESTRICTION_NONE 
ICAL_RESTRICTION_ZERO 
ICAL_RESTRICTION_ONE 
ICAL_RESTRICTION_ZEROPLUS 
ICAL_RESTRICTION_ONEPLUS 
ICAL_RESTRICTION_ZEROORONE 
ICAL_RESTRICTION_ONEEXCLUSIVE 
ICAL_RESTRICTION_ONEMUTUAL 
ICAL_RESTRICTION_UNKNOWN 
ICAL_RESTRICTION_NONE 
ICAL_RESTRICTION_ZERO 
ICAL_RESTRICTION_ONE 
ICAL_RESTRICTION_ZEROPLUS 
ICAL_RESTRICTION_ONEPLUS 
ICAL_RESTRICTION_ZEROORONE 
ICAL_RESTRICTION_ONEEXCLUSIVE 
ICAL_RESTRICTION_ONEMUTUAL 
ICAL_RESTRICTION_UNKNOWN 

Definition at line 37 of file icalrestriction.h.


Function Documentation

int icalrestriction_check ( icalcomponent *  comp)

Definition at line 371 of file icalrestriction.c.

{
    icalcomponent_kind comp_kind;
    icalproperty_method method;
    icalcomponent* inner_comp;
    icalproperty *method_prop;
    int valid;
    
    icalerror_check_arg_rz( (outer_comp!=0), "outer comp");


    /* Get the Method value from the outer component */

    comp_kind = icalcomponent_isa(outer_comp);

    if (comp_kind != ICAL_VCALENDAR_COMPONENT){
       icalerror_set_errno(ICAL_BADARG_ERROR);
       return 0;
    }

    method_prop = icalcomponent_get_first_property(outer_comp,
                                             ICAL_METHOD_PROPERTY);

    if (method_prop == 0){
       method = ICAL_METHOD_NONE;
    } else {
       method = icalproperty_get_method(method_prop);
    }
   

    /* Check the VCALENDAR wrapper */
    valid = icalrestriction_check_component(ICAL_METHOD_NONE,outer_comp);


    /* Now check the inner components */

    for(inner_comp= icalcomponent_get_first_component(outer_comp,
                                                ICAL_ANY_COMPONENT);
       inner_comp != 0;
       inner_comp= icalcomponent_get_next_component(outer_comp,
                                               ICAL_ANY_COMPONENT)){

       valid = valid && icalrestriction_check_component(method,inner_comp);

    }


    return valid;

}

Here is the call graph for this function:

Definition at line 101 of file icalrestriction.c.

                                                              {

    if ( restr < ICAL_RESTRICTION_NONE || restr > ICAL_RESTRICTION_UNKNOWN
        || count < 0){
       return -1;
    }

    if (count > 2) {
       count = 2;
    }

    return compare_map[restr][count];

}