Logo Search packages:      
Sourcecode: libical version File versions

static int icaltimezone_get_vtimezone_properties ( icaltimezone *  zone,
icalcomponent *  component 
) [static]

Gets the TZID, LOCATION/X-LIC-LOCATION, and TZNAME properties from the VTIMEZONE component and places them in the icaltimezone. It returns 1 on success, or 0 if the TZID can't be found.

Gets the TZID, LOCATION/X-LIC-LOCATION and TZNAME properties of the VTIMEZONE component and stores them in the icaltimezone. It returns 1 on success, or 0 if the TZID can't be found. Note that it expects the zone to be initialized or reset - it doesn't free any old values.

Definition at line 296 of file icaltimezone.c.

References icaltimezone_get_location_from_vtimezone(), and icaltimezone_get_tznames_from_vtimezone().

Referenced by icaltimezone_load_builtin_timezone(), and icaltimezone_set_component().

{
    icalproperty *prop;
    const char *tzid, *tzname;
 
    prop = icalcomponent_get_first_property (component, ICAL_TZID_PROPERTY);
    if (!prop)
      return 0;

    /* A VTIMEZONE MUST have a TZID, or a lot of our code won't work. */
    tzid = icalproperty_get_tzid (prop);
    if (!tzid)
      return 0;

    prop = icalcomponent_get_first_property (component, ICAL_TZNAME_PROPERTY);
    if (prop) {
      tzname = icalproperty_get_tzname (prop);
      zone->tznames = strdup(tzname);     
    } else
      zone->tznames = NULL;
    
    zone->tzid = strdup (tzid);
    zone->component = component;
      if ( zone->location != 0 ) free ( zone->location );
    zone->location = icaltimezone_get_location_from_vtimezone (component);
    zone->tznames = icaltimezone_get_tznames_from_vtimezone (component);

    return 1;
}


Generated by  Doxygen 1.6.0   Back to index