Libical API Documentation 4.0 UNRELEASED Go to the stable 3.0 documentation
Loading...
Searching...
No Matches
icalcomponent.h File Reference

Defines the data structure for iCalendar components. More...

Go to the source code of this file.

Functions

icalcomponent * icalcompiter_deref (icalcompiter *i)
bool icalcompiter_is_valid (const icalcompiter *i)
icalcomponent * icalcompiter_next (icalcompiter *i)
icalcomponent * icalcompiter_prior (icalcompiter *i)
void icalcomponent_add_component (icalcomponent *parent, icalcomponent *child)
void icalcomponent_add_property (icalcomponent *component, icalproperty *property)
char * icalcomponent_as_ical_string (const icalcomponent *component)
char * icalcomponent_as_ical_string_r (const icalcomponent *component)
icalcompiter icalcomponent_begin_component (icalcomponent *component, icalcomponent_kind kind)
icalpropiter icalcomponent_begin_property (icalcomponent *component, icalproperty_kind kind)
bool icalcomponent_check_restrictions (icalcomponent *comp)
icalcomponent * icalcomponent_clone (const icalcomponent *old)
void icalcomponent_convert_errors (icalcomponent *component)
int icalcomponent_count_components (icalcomponent *component, icalcomponent_kind kind)
int icalcomponent_count_errors (icalcomponent *component)
int icalcomponent_count_properties (icalcomponent *component, icalproperty_kind kind)
icalcompiter icalcomponent_end_component (icalcomponent *component, icalcomponent_kind kind)
void icalcomponent_foreach_recurrence (icalcomponent *comp, struct icaltimetype start, struct icaltimetype end, void(*callback)(icalcomponent *comp, const struct icaltime_span *span, void *data), void *callback_data)
void icalcomponent_foreach_tzid (icalcomponent *comp, void(*callback)(icalparameter *param, void *data), void *callback_data)
void icalcomponent_free (icalcomponent *component)
const char * icalcomponent_get_comment (icalcomponent *comp)
const char * icalcomponent_get_component_name (const icalcomponent *comp)
char * icalcomponent_get_component_name_r (const icalcomponent *comp)
icalcomponent * icalcomponent_get_current_component (icalcomponent *component)
icalproperty * icalcomponent_get_current_property (icalcomponent *component)
const char * icalcomponent_get_description (icalcomponent *comp)
struct icaltimetype icalcomponent_get_dtend (icalcomponent *comp)
struct icaltimetype icalcomponent_get_dtstamp (icalcomponent *comp)
struct icaltimetype icalcomponent_get_dtstart (icalcomponent *comp)
struct icaltimetype icalcomponent_get_due (icalcomponent *comp)
struct icaldurationtype icalcomponent_get_duration (icalcomponent *comp)
icalcomponent * icalcomponent_get_first_component (icalcomponent *component, icalcomponent_kind kind)
icalproperty * icalcomponent_get_first_property (icalcomponent *component, icalproperty_kind kind)
icalcomponent * icalcomponent_get_first_real_component (const icalcomponent *c)
const char * icalcomponent_get_iana_name (const icalcomponent *comp)
icalcomponent * icalcomponent_get_inner (icalcomponent *comp)
const char * icalcomponent_get_location (icalcomponent *comp)
icalproperty_method icalcomponent_get_method (icalcomponent *comp)
icalcomponent * icalcomponent_get_next_component (icalcomponent *component, icalcomponent_kind kind)
icalproperty * icalcomponent_get_next_property (icalcomponent *component, icalproperty_kind kind)
struct icaltimetype icalcomponent_get_recurrenceid (icalcomponent *comp)
const char * icalcomponent_get_relcalid (icalcomponent *comp)
int icalcomponent_get_sequence (icalcomponent *comp)
struct icaltime_span icalcomponent_get_span (icalcomponent *comp)
enum icalproperty_status icalcomponent_get_status (icalcomponent *comp)
const char * icalcomponent_get_summary (icalcomponent *comp)
icaltimezoneicalcomponent_get_timezone (icalcomponent *comp, const char *tzid)
const char * icalcomponent_get_uid (icalcomponent *comp)
const char * icalcomponent_get_x_name (const icalcomponent *comp)
bool icalcomponent_is_valid (const icalcomponent *component)
icalcomponent_kind icalcomponent_isa (const icalcomponent *component)
bool icalcomponent_isa_component (const void *component)
bool icalcomponent_kind_is_valid (const icalcomponent_kind kind)
const char * icalcomponent_kind_to_string (icalcomponent_kind kind)
void icalcomponent_merge_component (icalcomponent *comp, icalcomponent *comp_to_merge)
icalcomponent * icalcomponent_new (icalcomponent_kind kind)
icalcomponent * icalcomponent_new_from_string (const char *str)
icalcomponent * icalcomponent_new_iana (const char *iana_name)
icalcomponent * icalcomponent_new_participant (void)
icalcomponent * icalcomponent_new_vagenda (void)
icalcomponent * icalcomponent_new_valarm (void)
icalcomponent * icalcomponent_new_vavailability (void)
icalcomponent * icalcomponent_new_vcalendar (void)
icalcomponent * icalcomponent_new_vevent (void)
icalcomponent * icalcomponent_new_vfreebusy (void)
icalcomponent * icalcomponent_new_vjournal (void)
icalcomponent * icalcomponent_new_vlocation (void)
icalcomponent * icalcomponent_new_vpatch (void)
icalcomponent * icalcomponent_new_vpoll (void)
icalcomponent * icalcomponent_new_vquery (void)
icalcomponent * icalcomponent_new_vreply (void)
icalcomponent * icalcomponent_new_vresource (void)
icalcomponent * icalcomponent_new_vtimezone (void)
icalcomponent * icalcomponent_new_vtodo (void)
icalcomponent * icalcomponent_new_vvoter (void)
icalcomponent * icalcomponent_new_x (const char *x_name)
icalcomponent * icalcomponent_new_xavailable (void)
icalcomponent * icalcomponent_new_xdaylight (void)
icalcomponent * icalcomponent_new_xpatch (void)
icalcomponent * icalcomponent_new_xstandard (void)
icalcomponent * icalcomponent_new_xvote (void)
void icalcomponent_normalize (icalcomponent *comp)
void icalcomponent_remove_component (icalcomponent *parent, icalcomponent *child)
void icalcomponent_remove_property (icalcomponent *component, icalproperty *property)
void icalcomponent_remove_property_by_kind (icalcomponent *component, icalproperty_kind kind)
void icalcomponent_set_comment (icalcomponent *comp, const char *v)
void icalcomponent_set_description (icalcomponent *comp, const char *v)
void icalcomponent_set_dtend (icalcomponent *comp, struct icaltimetype v)
void icalcomponent_set_dtstamp (icalcomponent *comp, struct icaltimetype v)
void icalcomponent_set_dtstart (icalcomponent *comp, struct icaltimetype v)
void icalcomponent_set_due (icalcomponent *comp, struct icaltimetype v)
void icalcomponent_set_duration (icalcomponent *comp, struct icaldurationtype v)
void icalcomponent_set_iana_name (icalcomponent *comp, const char *name)
void icalcomponent_set_location (icalcomponent *comp, const char *v)
void icalcomponent_set_method (icalcomponent *comp, icalproperty_method method)
void icalcomponent_set_recurrenceid (icalcomponent *comp, struct icaltimetype v)
void icalcomponent_set_relcalid (icalcomponent *comp, const char *v)
void icalcomponent_set_sequence (icalcomponent *comp, int v)
void icalcomponent_set_status (icalcomponent *comp, enum icalproperty_status v)
void icalcomponent_set_summary (icalcomponent *comp, const char *v)
void icalcomponent_set_uid (icalcomponent *comp, const char *v)
void icalcomponent_set_x_name (icalcomponent *comp, const char *name)
icalcomponent_kind icalcomponent_string_to_kind (const char *string)
void icalcomponent_strip_errors (icalcomponent *component)
icalcomponent * icalcomponent_vanew (icalcomponent_kind kind,...)
struct icaltimetype icalproperty_get_datetime_with_component (icalproperty *prop, icalcomponent *comp)
icalcomponent * icalproperty_get_parent (const icalproperty *property)
bool icalproperty_recurrence_is_excluded (icalcomponent *comp, struct icaltimetype *dtstart, struct icaltimetype *recurtime)
 Decides if a recurrence is acceptable.
void icalproperty_set_parent (icalproperty *property, icalcomponent *component)
icalproperty * icalpropiter_deref (icalpropiter *i)
bool icalpropiter_is_valid (const icalpropiter *i)
icalproperty * icalpropiter_next (icalpropiter *i)

Detailed Description

Defines the data structure for iCalendar components.

Definition in file icalcomponent.h.

Function Documentation

◆ icalcompiter_deref()

icalcomponent * icalcompiter_deref ( icalcompiter * i)

Gets the current icalcomponent referenced by the specified icalcompiter.

Parameters
ia pointer to a valid icalcompiter
Returns
a pointer to the icalcomponent associated to i or NULL if i is invalid.

Definition at line 1484 of file icalcomponent.c.

◆ icalcompiter_is_valid()

bool icalcompiter_is_valid ( const icalcompiter * i)

Checks if the specified icalcompiter is valid.

Parameters
ia pointer to a possibly invalid icalcompiter
Returns
true if i points to a valid icalcompiter; false otherwise.
Since
4.0

Definition at line 1392 of file icalcomponent.c.

◆ icalcompiter_next()

icalcomponent * icalcompiter_next ( icalcompiter * i)

Gets the next icalcomponent referenced by the specified icalcompiter with a matching icalcomponent_kind.

Parameters
ia pointer to a valid icalcomponent
Returns
a pointer to the next icalcomponent with a matching icalcomponent_kind after the one referenced by i. NULL is returned if is invalid or if there are no matches found.

Definition at line 1446 of file icalcomponent.c.

◆ icalcompiter_prior()

icalcomponent * icalcompiter_prior ( icalcompiter * i)

Gets the previous icalcomponent referenced by the specified icalcompiter with a matching icalcomponent_kind.

Parameters
ia pointer to a valid icalcomponent
Returns
a pointer to the previous icalcomponent with a matching icalcomponent_kind before the one referenced by i. NULL is returned if is invalid or if there are no matches found.

Definition at line 1465 of file icalcomponent.c.

◆ icalcomponent_add_component()

void icalcomponent_add_component ( icalcomponent * parent,
icalcomponent * child )

Attaches a child icalcomponent to a parent icalcomponent

Parameters
parenta pointer to a valid parent icalcomponent
childa pointer to a valid child icalcomponent

Definition at line 552 of file icalcomponent.c.

◆ icalcomponent_add_property()

void icalcomponent_add_property ( icalcomponent * component,
icalproperty * property )

Adds an icalproperty to the specified icalcomponent.

No error checking is performed by this function, although it will assert if the specified icalproperty has already been added.

Parameters
componenta pointer to a valid icalcomponent
propertya pointer to a presumably valid icalproperty

Definition at line 428 of file icalcomponent.c.

◆ icalcomponent_as_ical_string()

char * icalcomponent_as_ical_string ( const icalcomponent * component)

Creates a character string representation of an icalcomponent.

Parameters
componenta pointer to a icalcomponent
Returns
a pointer to a char string containing the component string representation; NULL if a memory allocation failure is encountered.
See also
icalcomponent_as_ical_string_r

Definition at line 234 of file icalcomponent.c.

◆ icalcomponent_as_ical_string_r()

char * icalcomponent_as_ical_string_r ( const icalcomponent * component)

Creates a character string representation of an icalcomponent.

Parameters
componenta pointer to a icalcomponent
Returns
a pointer to a char string containing the component string representation; NULL if a memory allocation failure is encountered.
See also
icalcomponent_as_ical_string

Definition at line 245 of file icalcomponent.c.

◆ icalcomponent_begin_component()

icalcompiter icalcomponent_begin_component ( icalcomponent * component,
icalcomponent_kind kind )

Gets an icalcompiter associated to the first icalcomponent with icalcomponent_kind attached to the specified icalcomponent.

Parameters
componenta pointer to a valid icalcomponent
kindthe icalcomponent_kind to use for the search
Returns
an icalcompiter for the first component found with icalcomponent_kind kind; Use icalcompiter_is_valid() to determine if the return value is valid.

Definition at line 1401 of file icalcomponent.c.

◆ icalcomponent_begin_property()

icalpropiter icalcomponent_begin_property ( icalcomponent * component,
icalproperty_kind kind )

Gets an icalpropiter associated to the first icalproperty with icalproperty_kind attached to the specified icalcomponent.

Parameters
componenta pointer to a valid icalcomponent
kindthe ical_property_kind to use for the search
Returns
an icalpropiter for the first property found with icalproperty_kind kind; Use icalpropiter_is_valid() to determine if the return value is valid.

Definition at line 1495 of file icalcomponent.c.

◆ icalcomponent_check_restrictions()

bool icalcomponent_check_restrictions ( icalcomponent * comp)

Checks restrictions on the specified icalcomponent

Parameters
compa pointer to a valid icalcomponent
Returns
true if comp is a VCALENDAR component and it has restrictions; other false is returned. If a non-VCALENDER component is encountered the internal library icalerrno is set to ICAL_BADARG_ERROR.

Definition at line 1160 of file icalcomponent.c.

◆ icalcomponent_clone()

icalcomponent * icalcomponent_clone ( const icalcomponent * old)

Deeply clones an icalcomponent.

Free the allocated memory with icalcomponent_free.

Parameters
olda pointer to a valid icalcomponent
Returns
a pointer to the memory for the newly cloned icalcomponent.
Since
4.0

Definition at line 137 of file icalcomponent.c.

◆ icalcomponent_convert_errors()

void icalcomponent_convert_errors ( icalcomponent * component)

Converts X-LIC-ERROR into RETURN-STATUS properties in an icalcomponent.

Parameters
componenta pointer to a valid icalcomponent

Definition at line 1211 of file icalcomponent.c.

◆ icalcomponent_count_components()

int icalcomponent_count_components ( icalcomponent * component,
icalcomponent_kind kind )

Gets the number of components of an icalcomponent_kind in an icalcomponent.

Parameters
componenta pointer to a valid icalcomponent
kindthe icalcomponent_kind to use for the search
Returns
the number of kind component types attached to component.

Definition at line 626 of file icalcomponent.c.

◆ icalcomponent_count_errors()

int icalcomponent_count_errors ( icalcomponent * component)

Gets the number of errors encountered parsing the data.

Parameters
componenta pointer to a valid icalcomponent
Returns
the number of X-LIC-ERROR instances in the specified icalcomponent.

Definition at line 1166 of file icalcomponent.c.

◆ icalcomponent_count_properties()

int icalcomponent_count_properties ( icalcomponent * component,
icalproperty_kind kind )

Gets the number of properties of an icalproperty_kind in an icalcomponent.

Parameters
componenta pointer to a valid icalcomponent
kindthe ical_property_kind to use for the search
Returns
the number of kind property types attached to component.

Definition at line 490 of file icalcomponent.c.

◆ icalcomponent_end_component()

icalcompiter icalcomponent_end_component ( icalcomponent * component,
icalcomponent_kind kind )

Gets an icalcompiter associated to the last icalcomponent with icalcomponent_kind attached to the specified icalcomponent.

Parameters
componenta pointer to a valid icalcomponent
kindthe icalcomponent_kind to use for the search
Returns
an icalcompiter for the last component found with icalcomponent_kind kind; if no matches are found ::icalcompiter_null is returned.

Definition at line 1424 of file icalcomponent.c.

◆ icalcomponent_foreach_recurrence()

void icalcomponent_foreach_recurrence ( icalcomponent * comp,
struct icaltimetype start,
struct icaltimetype end,
void(* callback )(icalcomponent *comp, const struct icaltime_span *span, void *data),
void * callback_data )

Iterates through all recurrences of an event.

Parameters
compa pointer to a VEVENT icalcomponent
startIgnore timespans before this
endIgnore timespans after this
callbackFunction called for each timespan within the range
callback_dataPointer passed back to the callback function

This function will call the specified callback function for once for the base value of DTSTART, and foreach recurring date/time value.

It will filter out events that are specified as an EXDATE or an EXRULE.

Definition at line 970 of file icalcomponent.c.

◆ icalcomponent_foreach_tzid()

void icalcomponent_foreach_tzid ( icalcomponent * comp,
void(* callback )(icalparameter *param, void *data),
void * callback_data )

Calls the given function for each TZID parameter found in the component, as well as any subcomponents.

Parameters
compa pointer to a valid icalcomponent
callbacka pointer to a function to call for each TZID parameter
callback_dataa pointer to data associated with the callback function

Definition at line 2457 of file icalcomponent.c.

◆ icalcomponent_free()

void icalcomponent_free ( icalcomponent * component)

Destruct the specified icalcomponent.

Frees the memory alloced for the specified icalcomponent.

Parameters
componenta pointer to a valid icalcompent

Definition at line 191 of file icalcomponent.c.

◆ icalcomponent_get_comment()

const char * icalcomponent_get_comment ( icalcomponent * comp)

Gets the COMMENT property for the specified icalcomponent.

Parameters
compa pointer to a valid icalcomponent
Returns
pointer to a char string with the COMMENT property for comp. If there is no such property then a value of NULL is returned. If comp is invalid then a value of NULL is returned and the internal library icalerrno is set to ICAL_MALFORMEDDATA_ERROR.

Definition at line 1845 of file icalcomponent.c.

◆ icalcomponent_get_component_name()

const char * icalcomponent_get_component_name ( const icalcomponent * comp)

Gets the name of the specified icalcomponent.

The icalcomponent's name is its type name converted to a string, or the value of _get_x_name if is an X- component type.

Parameters
compa pointer to a valid icalcomponent
Returns
a pointer to a char string with the name of the specified icalcomponent.
See also
icalcomponent_get_component_name_r

Definition at line 386 of file icalcomponent.c.

◆ icalcomponent_get_component_name_r()

char * icalcomponent_get_component_name_r ( const icalcomponent * comp)

Gets the name of the specified icalcomponent.

The icalcomponent's name is its type name converted to a string, or the value of _get_x_name if is an X- component type.

Parameters
compa pointer to a valid icalcomponent
Returns
a pointer to a char string with the name of the specified icalcomponent.
See also
icalcomponent_get_component_name

Definition at line 395 of file icalcomponent.c.

◆ icalcomponent_get_current_component()

icalcomponent * icalcomponent_get_current_component ( icalcomponent * component)

Gets the icalcomponent associated to the current icalcompiter of the specified icalcomponent.

Parameters
componenta pointer to a valid icalcomponent
Returns
a pointer to the current icalcomponent

Definition at line 643 of file icalcomponent.c.

◆ icalcomponent_get_current_property()

icalproperty * icalcomponent_get_current_property ( icalcomponent * component)

Gets the icalproperty associated to the current icalpropiter of the specified icalcomponent.

Parameters
componenta pointer to a valid icalcomponent
Returns
a pointer to the current icalproperty or NULL if the current icalpropiter is invalid.

Definition at line 506 of file icalcomponent.c.

◆ icalcomponent_get_description()

const char * icalcomponent_get_description ( icalcomponent * comp)

Gets the DESCRIPTION property of the specified icalcomponent.

Parameters
compa pointer to a valid icalcomponent
Returns
pointer to a char string with the DESCRIPTION property for comp. If there is no such property then a value of NULL is returned. If comp is invalid then a value of NULL is returned and the internal library icalerrno is set to ICAL_MALFORMEDDATA_ERROR.

Definition at line 1961 of file icalcomponent.c.

◆ icalcomponent_get_dtend()

struct icaltimetype icalcomponent_get_dtend ( icalcomponent * comp)

Gets the DTEND property of an icalcomponent.

If a DTEND property is not present but a DURATION is, we use that to determine the proper end.

If DTSTART is a DATE-TIME with a timezone parameter and a corresponding VTIMEZONE is present in the component, the returned component will already be in the correct timezone; otherwise the caller is responsible for converting it.

For the icalcomponent routines only, dtend and duration are tied together. If you call the get routine for one and the other exists, the routine will calculate the return value. That is, if there is a DTEND and you call get_duration, the routine will return the difference between DTEND and DTSTART.

When DURATION and DTEND are both missing, for VEVENT an implicit DTEND is calculated based of DTSTART; for AVAILABLE, VAVAILABILITY, and VFREEBUSY null-time is returned.

Parameters
compa pointer to a valid icalcomponent
Returns
null-time, unless called on AVAILABLE, VEVENT, VAVAILABILITY, or VFREEBUSY components.

FIXME this is useless until we can flag the failure

Definition at line 1630 of file icalcomponent.c.

◆ icalcomponent_get_dtstamp()

struct icaltimetype icalcomponent_get_dtstamp ( icalcomponent * comp)

Gets the DTSTAMP property for the specified icalcomponent.

Parameters
compa pointer to a valid icalcomponent
Returns
an icaltimetype with the DTSTAMP property for comp. If there is no such property then a value of icaltime_null_time() is returned. If comp is invalid then a value of icaltime_null_time() is returned and the internal library icalerrno is set to ICAL_MALFORMEDDATA_ERROR.

Definition at line 1786 of file icalcomponent.c.

◆ icalcomponent_get_dtstart()

struct icaltimetype icalcomponent_get_dtstart ( icalcomponent * comp)

Gets the DTSTART property of an icalcomponent.

If DTSTART is a DATE-TIME with a timezone parameter and a corresponding VTIMEZONE is present in the component, the returned component will already be in the correct timezone; otherwise the caller is responsible for converting it.

Parameters
compa pointer to a valid icalcomponent

FIXME this is useless until we can flag the failure

Returns
the DTSTART as an icaltimetype of the specified icalcomponent.

Definition at line 1617 of file icalcomponent.c.

◆ icalcomponent_get_due()

struct icaltimetype icalcomponent_get_due ( icalcomponent * comp)

Gets the DUE property of a VTODO icalcomponent.

Parameters
compa pointer to a valid VTODO icalcomponent

Uses the DUE property if it exists, otherwise we calculate the DUE value by adding the task's duration to the DTSTART time.

Returns
the DURATION as an icaltimetype of the specified icalcomponent

Definition at line 2662 of file icalcomponent.c.

◆ icalcomponent_get_duration()

struct icaldurationtype icalcomponent_get_duration ( icalcomponent * comp)

Gets the DURATION property of an icalcomponent.

For the icalcomponent routines only, DTEND and DURATION are tied together. If you call the get routine for one and the other exists, the routine will calculate the return value. That is, if there is a DTEND and you call get_duration, the routine will return the difference between DTEND and DTSTART in AVAILABLE, VEVENT, or VAVAILABILITY; and the difference between DUE and DTSTART in VTODO. When both DURATION and DTEND are missing from VEVENT an implicit duration is returned, based on the value-type of DTSTART. Otherwise null-duration is returned.

Parameters
compa pointer to a valid icalcomponent
Returns
the DURATION as an icalduration of the specified icalcomponent.

Definition at line 1728 of file icalcomponent.c.

◆ icalcomponent_get_first_component()

icalcomponent * icalcomponent_get_first_component ( icalcomponent * component,
icalcomponent_kind kind )

From the head position, iterates the icalcomponent list attached to the specified icalcomponent until the first icalcomponent_kind is found.

Parameters
componenta pointer to a valid icalcomponent
kindan icalcomponent_kind to use for the search
Returns
a pointer to the first icalcomponent found of icalcomponent_kind kind; NULL if no matches are found.

Definition at line 654 of file icalcomponent.c.

◆ icalcomponent_get_first_property()

icalproperty * icalcomponent_get_first_property ( icalcomponent * component,
icalproperty_kind kind )

From the head position, iterates the icalproperty list attached to the specified icalcomponent until the first icalproperty_kind is found.

Parameters
componenta pointer to a valid icalcomponent
kindan icalproperty_kind to use for the search
Returns
a pointer to the first icalproperty found of icalproperty_kind kind; NULL if no matches are found.

Definition at line 517 of file icalcomponent.c.

◆ icalcomponent_get_first_real_component()

icalcomponent * icalcomponent_get_first_real_component ( const icalcomponent * c)

Get a reference to the first VEVENT, VTODO or VJOURNAL in an icalcomponent.

Parameters
ca pointer to a valid icalcomponent
Returns
a pointer to the first VEVENT, VTODO or VJOURNAL found in the specified icalcomponent, or NULL if none are found.

Definition at line 690 of file icalcomponent.c.

◆ icalcomponent_get_iana_name()

const char * icalcomponent_get_iana_name ( const icalcomponent * comp)

Gets the IANA name of the specified icalcomponent.

Parameters
compa pointer to a valid icalcomponent
Returns
a pointer to a char string containing the comp IANA name; will be NULL if the name has yet to be specified.
Since
4.0

Definition at line 378 of file icalcomponent.c.

◆ icalcomponent_get_inner()

icalcomponent * icalcomponent_get_inner ( icalcomponent * comp)

Gets a pointer to the first VEVENT, VTODO or VJOURNAL sub-component located in the specified icalcomponent.

Parameters
compa pointer to a valid icalcomponent
Returns
a pointer to the first VEVENT, VTODO or VJOURNAL located in the specified icalcomponent. comp itself returned if it is found to be a VEVENT, VTODO or VJOURNAL. NULL is returned if the search failed.

Definition at line 1552 of file icalcomponent.c.

◆ icalcomponent_get_location()

const char * icalcomponent_get_location ( icalcomponent * comp)

Gets the LOCATION property of the specified icalcomponent.

Parameters
compa pointer to a valid icalcomponent
Returns
a pointer to a char string with the LOCATION property for comp. If there is no such property then a value of NULL is returned. If comp is invalid then a value of NULL is returned and the internal library icalerrno is set to ICAL_MALFORMEDDATA_ERROR.

Definition at line 1996 of file icalcomponent.c.

◆ icalcomponent_get_method()

icalproperty_method icalcomponent_get_method ( icalcomponent * comp)

Gets the METHOD property of an icalcomponent.

Parameters
compa pointer to a valid icalcomponent
Returns
an icalproperty_method with the METHOD property for comp. If there is no such property then a value of ICAL_METHOD_NONE is returned. If comp is invalid then a value of ICAL_METHOD_NONE is returned and the internal library icalerrno is set to ICAL_MALFORMEDDATA_ERROR.

Definition at line 1573 of file icalcomponent.c.

◆ icalcomponent_get_next_component()

icalcomponent * icalcomponent_get_next_component ( icalcomponent * component,
icalcomponent_kind kind )

From the current position, iterates the icalcomponent list attached to the specified icalcomponent until the next icalcomponent_kind is found.

Parameters
componenta pointer to a valid icalcomponent
kindan icalcomponent_kind to use for the search
Returns
a pointer to the next icalcomponent found of icalcomponent_kind kind; NULL if no matches are found.

Definition at line 670 of file icalcomponent.c.

◆ icalcomponent_get_next_property()

icalproperty * icalcomponent_get_next_property ( icalcomponent * component,
icalproperty_kind kind )

From the current position, iterates the icalproperty list attached to the specified icalcomponent until the next icalproperty_kind is found.

Parameters
componenta pointer to a valid icalcomponent
kindan icalproperty_kind to use for the search
Returns
a pointer to the next icalproperty found of icalproperty_kind kind; NULL if no matches are found.

Definition at line 532 of file icalcomponent.c.

◆ icalcomponent_get_recurrenceid()

struct icaltimetype icalcomponent_get_recurrenceid ( icalcomponent * comp)

Gets the RECURRENCEID property of the specified icalcomponent.

Parameters
compa pointer to a valid icalcomponent
Returns
an icaltimetype with the RECURRENCEID property for comp. If there is no such property then a value of icaltime_null_time() is returned. If comp is invalid then a value of icaltime_null_time() is returned and the internal library icalerrno is set to ICAL_MALFORMEDDATA_ERROR.

Definition at line 1923 of file icalcomponent.c.

◆ icalcomponent_get_relcalid()

const char * icalcomponent_get_relcalid ( icalcomponent * comp)

Gets the RELCALID property of an icalcomponent.

Parameters
compa pointer to a valid icalcomponent
Returns
the relcalid of the specified icalcomponent. If there is no such property then a value of NULL is returned. If comp is invalid then a value of NULL is returned and the internal library icalerrno is set to ICAL_MALFORMEDDATA_ERROR.

Definition at line 2640 of file icalcomponent.c.

◆ icalcomponent_get_sequence()

int icalcomponent_get_sequence ( icalcomponent * comp)

Gets the SEQUENCE property of the specified icalcomponent.

Parameters
compa pointer to a valid icalcomponent
Returns
a integer SEQUENCE property for comp. If there is no such property then a value of zero is returned. If comp is invalid then a value of zero is returned and the internal library icalerrno is set to ICAL_MALFORMEDDATA_ERROR.

Definition at line 2031 of file icalcomponent.c.

◆ icalcomponent_get_span()

struct icaltime_span icalcomponent_get_span ( icalcomponent * comp)

Gets the timespan covered by the specified icalcomponent, in UTC.

See icalcomponent_foreach_recurrence() for a better way to extract spans from a component.

This method can be called on either a VCALENDAR or any real component. If the VCALENDAR contains no real component, but contains a VTIMEZONE, we return that span instead. This might not be a desirable behavior; we keep it for now for backward compatibility, but it might be deprecated at a future time.

Parameters
compa pointer to a valid icalcomponent

FIXME this API needs to be clarified. DTEND is defined as the first available time after the end of this event, so the span should actually end 1 second before DTEND.

Returns
the timespan in icaltime_span covered by the specified icalcomponent.
See also
icalcomponent_foreach_recurrence

Definition at line 713 of file icalcomponent.c.

◆ icalcomponent_get_status()

enum icalproperty_status icalcomponent_get_status ( icalcomponent * comp)

Gets the status property of the icalcomponent.

Parameters
compa pointer to a valid icalcomponent
Returns
in normal conditions, the status property as an icalproperty_status of the specified icalcomponent; else ICAL_STATUS_NONE if a problem parsing the status was detected.

Definition at line 2066 of file icalcomponent.c.

◆ icalcomponent_get_summary()

const char * icalcomponent_get_summary ( icalcomponent * comp)

Gets the SUMMARY property for the specified icalcomponent.

Parameters
compa pointer to a valid icalcomponent
Returns
pointer to a char string with the SUMMARY property for comp. If there is no such property then a value of NULL is returned. If comp is invalid then a value of NULL is returned and the internal library icalerrno is set to ICAL_MALFORMEDDATA_ERROR.

Definition at line 1810 of file icalcomponent.c.

◆ icalcomponent_get_timezone()

icaltimezone * icalcomponent_get_timezone ( icalcomponent * comp,
const char * tzid )

Return the icaltimezone in the component corresponding to the specified TZID, or NULL if a one cannot be found.

Parameters
compa pointer to a valid icalcomponent
tzida pointer to a char string containing the TZID
Returns
the icaltimezone in the specified icalcomponent corresponding to the TZID, or NULL if it can't be found.

Definition at line 2493 of file icalcomponent.c.

◆ icalcomponent_get_uid()

const char * icalcomponent_get_uid ( icalcomponent * comp)

Gets the UID property for the specified icalcomponent.

Parameters
compa pointer to a valid icalcomponent
Returns
pointer to a char string with the UID property for comp. If there is no such property then a value of NULL is returned. If comp is invalid then a value of NULL is returned and the internal library icalerrno is set to ICAL_MALFORMEDDATA_ERROR.

Definition at line 1880 of file icalcomponent.c.

◆ icalcomponent_get_x_name()

const char * icalcomponent_get_x_name ( const icalcomponent * comp)

Gets the X-NAME property of an icalcomponent.

Parameters
compa pointer to a valid icalcomponent
Returns
pointer to a char string with the X-NAME property for comp.

Definition at line 357 of file icalcomponent.c.

◆ icalcomponent_is_valid()

bool icalcomponent_is_valid ( const icalcomponent * component)

Determines if the specified icalcomponent is valid.

Parameters
componenta pointer to possibly invalid icalcomponent
Returns
true if component is valid; false otherwise.

Definition at line 314 of file icalcomponent.c.

◆ icalcomponent_isa()

icalcomponent_kind icalcomponent_isa ( const icalcomponent * component)

Determines the icalcomponent_kind of the specified icalcomponent.

Parameters
componenta pointer to valid icalcomponent.
Returns
the icalcomponent_kind of component.

Definition at line 324 of file icalcomponent.c.

◆ icalcomponent_isa_component()

bool icalcomponent_isa_component ( const void * component)

Determines if the specified pointer is an icalcomponent pointer.

Just looks if the ::id member strncmps to "comp".

Parameters
componenta pointer, presumably to an icalcomponent.
Returns
true if the pointer looks like an icalcomponent; false otherwise.

Definition at line 331 of file icalcomponent.c.

◆ icalcomponent_kind_is_valid()

bool icalcomponent_kind_is_valid ( const icalcomponent_kind kind)

Check the validity of the specified icalcomponent_kind.

Parameters
kindis the icalcomponent_kind to use
Returns
true if the icalcomponent_kind is valid; false otherwise.

Definition at line 1341 of file icalcomponent.c.

◆ icalcomponent_kind_to_string()

const char * icalcomponent_kind_to_string ( icalcomponent_kind kind)

Converts an icalcomponent_kind to its string representation.

Parameters
kindis the icalcomponent_kind to use
Returns
a pointer to a char string containing the string representation of the specified icalcomponent_kind.

Definition at line 1354 of file icalcomponent.c.

◆ icalcomponent_merge_component()

void icalcomponent_merge_component ( icalcomponent * comp,
icalcomponent * comp_to_merge )

Merges two VCALENDAR components.

This takes 2 VCALENDAR components and merges the second one into the first, resolving any problems with conflicting TZIDs. comp_to_merge will no longer exist after calling this function.

Parameters
compa pointer to a valid icalcomponent
comp_to_mergea pointer to a valid icalcompent to merge into comp

Definition at line 2203 of file icalcomponent.c.

◆ icalcomponent_new()

icalcomponent * icalcomponent_new ( icalcomponent_kind kind)

Constructs a new icalcomponent of a specified kind.

The data structure contains all null values and is essentially invalid. Free the allocated memory with icalcomponent_free.

Parameters
kindis the icalcompent_kind to construct
Returns
a pointer to a valid icalcomponent.

Definition at line 108 of file icalcomponent.c.

◆ icalcomponent_new_from_string()

icalcomponent * icalcomponent_new_from_string ( const char * str)

Construct a new icalcomponent from a character string.

Free the allocated memory with icalcomponent_free.

Parameters
stra char string containing a properly formatted ICS calendar.
Returns
a pointer to an icalcomponent or NULL if an anomaly was encountered. To handle parse errors, set the icalparser_state to ICALPARSER_ERROR and/or return components of the type ICAL_XLICINVALID_COMPONENT, or components with properties of the type ICAL_XLICERROR_PROPERTY.

Definition at line 132 of file icalcomponent.c.

◆ icalcomponent_new_iana()

icalcomponent * icalcomponent_new_iana ( const char * iana_name)

Construct a new icalcomponent with an IANA component name.

Parameters
iana_namea pointer to a char string containing the IANA name.
Returns
A pointer to a new icalcomponent; or NULL on memory allocation failure.
Since
4.0

Definition at line 180 of file icalcomponent.c.

◆ icalcomponent_new_participant()

icalcomponent * icalcomponent_new_participant ( void )

Constructs a new ICAL_PARTICIPANT_COMPONENT icalcomponent.

Returns
a pointer to the new icalcomponet. Free with icalcomponent_free

Definition at line 2184 of file icalcomponent.c.

◆ icalcomponent_new_vagenda()

icalcomponent * icalcomponent_new_vagenda ( void )

Constructs a new ICAL_VAGENDA_COMPONENT icalcomponent.

Returns
a pointer to the new icalcomponet. Free with icalcomponent_free

Definition at line 2134 of file icalcomponent.c.

◆ icalcomponent_new_valarm()

icalcomponent * icalcomponent_new_valarm ( void )

Constructs a new ICAL_VALARM_COMPONENT icalcomponent.

Returns
a pointer to the new icalcomponet. Free with icalcomponent_free

Definition at line 2109 of file icalcomponent.c.

◆ icalcomponent_new_vavailability()

icalcomponent * icalcomponent_new_vavailability ( void )

Constructs a new ICAL_VAVAILABILITY_COMPONENT icalcomponent.

Returns
a pointer to the new icalcomponet. Free with icalcomponent_free

Definition at line 2149 of file icalcomponent.c.

◆ icalcomponent_new_vcalendar()

icalcomponent * icalcomponent_new_vcalendar ( void )

Constructs a new ICAL_VCALENDAR_COMPONENT icalcomponent.

Returns
a pointer to the new icalcomponet. Free with icalcomponent_free

Definition at line 2089 of file icalcomponent.c.

◆ icalcomponent_new_vevent()

icalcomponent * icalcomponent_new_vevent ( void )

Constructs a new ICAL_VEVENT_COMPONENT icalcomponent.

Returns
a pointer to the new icalcomponet. Free with icalcomponent_free

Definition at line 2094 of file icalcomponent.c.

◆ icalcomponent_new_vfreebusy()

icalcomponent * icalcomponent_new_vfreebusy ( void )

Constructs a new ICAL_VFREEBUSY_COMPONENT icalcomponent.

Returns
a pointer to the new icalcomponet. Free with icalcomponent_free

Definition at line 2114 of file icalcomponent.c.

◆ icalcomponent_new_vjournal()

icalcomponent * icalcomponent_new_vjournal ( void )

Constructs a new ICAL_VJOURNAL_COMPONENT icalcomponent.

Returns
a pointer to the new icalcomponet. Free with icalcomponent_free

Definition at line 2104 of file icalcomponent.c.

◆ icalcomponent_new_vlocation()

icalcomponent * icalcomponent_new_vlocation ( void )

Constructs a new ICAL_VLOCATION_COMPONENT icalcomponent.

Returns
a pointer to the new icalcomponet. Free with icalcomponent_free

Definition at line 2189 of file icalcomponent.c.

◆ icalcomponent_new_vpatch()

icalcomponent * icalcomponent_new_vpatch ( void )

Constructs a new ICAL_VPATCH_COMPONENT icalcomponent.

Returns
a pointer to the new icalcomponet. Free with icalcomponent_free

Definition at line 2174 of file icalcomponent.c.

◆ icalcomponent_new_vpoll()

icalcomponent * icalcomponent_new_vpoll ( void )

Constructs a new ICAL_VPOLL_COMPONENT icalcomponent.

Returns
a pointer to the new icalcomponet. Free with icalcomponent_free

Definition at line 2159 of file icalcomponent.c.

◆ icalcomponent_new_vquery()

icalcomponent * icalcomponent_new_vquery ( void )

Constructs a new ICAL_VQUERY_COMPONENT icalcomponent.

Returns
a pointer to the new icalcomponet. Free with icalcomponent_free

Definition at line 2139 of file icalcomponent.c.

◆ icalcomponent_new_vreply()

icalcomponent * icalcomponent_new_vreply ( void )

Constructs a new ICAL_VREPLY_COMPONENT icalcomponent.

Returns
a pointer to the new icalcomponet. Free with icalcomponent_free

Definition at line 2144 of file icalcomponent.c.

◆ icalcomponent_new_vresource()

icalcomponent * icalcomponent_new_vresource ( void )

Constructs a new ICAL_VRESOURCE_COMPONENT icalcomponent.

Returns
a pointer to the new icalcomponet. Free with icalcomponent_free

Definition at line 2194 of file icalcomponent.c.

◆ icalcomponent_new_vtimezone()

icalcomponent * icalcomponent_new_vtimezone ( void )

Constructs a new ICAL_VTIMEZONE_COMPONENT icalcomponent.

Returns
a pointer to the new icalcomponet. Free with icalcomponent_free

Definition at line 2119 of file icalcomponent.c.

◆ icalcomponent_new_vtodo()

icalcomponent * icalcomponent_new_vtodo ( void )

Constructs a new ICAL_VTODO_COMPONENT icalcomponent.

Returns
a pointer to the new icalcomponet. Free with icalcomponent_free

Definition at line 2099 of file icalcomponent.c.

◆ icalcomponent_new_vvoter()

icalcomponent * icalcomponent_new_vvoter ( void )

Constructs a new ICAL_VVOTER_COMPONENT icalcomponent.

Returns
a pointer to the new icalcomponet. Free with icalcomponent_free

Definition at line 2164 of file icalcomponent.c.

◆ icalcomponent_new_x()

icalcomponent * icalcomponent_new_x ( const char * x_name)

Construct a new X-NAME icalcomponent.

Free the allocated memory with icalcomponent_free.

Parameters
x_namea pointer to a char string containing the value for the "X-NAME"
Returns
a pointer to a valid icalcomponent.

Definition at line 169 of file icalcomponent.c.

◆ icalcomponent_new_xavailable()

icalcomponent * icalcomponent_new_xavailable ( void )

Constructs a new ICAL_XAVAILABLE_COMPONENT icalcomponent.

Returns
a pointer to the new icalcomponet. Free with icalcomponent_free

Definition at line 2154 of file icalcomponent.c.

◆ icalcomponent_new_xdaylight()

icalcomponent * icalcomponent_new_xdaylight ( void )

Constructs a new ICAL_XDAYLIGHT_COMPONENT icalcomponent.

Returns
a pointer to the new icalcomponet. Free with icalcomponent_free

Definition at line 2129 of file icalcomponent.c.

◆ icalcomponent_new_xpatch()

icalcomponent * icalcomponent_new_xpatch ( void )

Constructs a new ICAL_XPATCH_COMPONENT icalcomponent.

Returns
a pointer to the new icalcomponet. Free with icalcomponent_free

Definition at line 2179 of file icalcomponent.c.

◆ icalcomponent_new_xstandard()

icalcomponent * icalcomponent_new_xstandard ( void )

Constructs a new ICAL_XSTANDARD_COMPONENT icalcomponent.

Returns
a pointer to the new icalcomponet. Free with icalcomponent_free

Definition at line 2124 of file icalcomponent.c.

◆ icalcomponent_new_xvote()

icalcomponent * icalcomponent_new_xvote ( void )

Constructs a new ICAL_XVOTE_COMPONENT icalcomponent.

Returns
a pointer to the new icalcomponet. Free with icalcomponent_free

Definition at line 2169 of file icalcomponent.c.

◆ icalcomponent_normalize()

void icalcomponent_normalize ( icalcomponent * comp)

Normalizes (reorders and sorts the properties) the specified icalcomponent.

Parameters
compa pointer to a valid icalcomponent
Since
3.0

Definition at line 2882 of file icalcomponent.c.

◆ icalcomponent_remove_component()

void icalcomponent_remove_component ( icalcomponent * parent,
icalcomponent * child )

Detaches a child icalcomponent from a parent icalcomponent

Parameters
parenta pointer to a valid parent icalcomponent
childa pointer to a valid child icalcomponent

Definition at line 586 of file icalcomponent.c.

◆ icalcomponent_remove_property()

void icalcomponent_remove_property ( icalcomponent * component,
icalproperty * property )

Removes an icalproperty from the specified icalcomponent.

Parameters
componenta pointer to a valid icalcomponent
propertya pointer to the icalproperty to remove

Definition at line 443 of file icalcomponent.c.

◆ icalcomponent_remove_property_by_kind()

void icalcomponent_remove_property_by_kind ( icalcomponent * component,
icalproperty_kind kind )

Removes all icalproperty's of an icalproperty_kind from the specified icalcomponent.

Parameters
componenta pointer to a valid icalcomponent
kindis the icalproperty_kind to use

Definition at line 468 of file icalcomponent.c.

◆ icalcomponent_set_comment()

void icalcomponent_set_comment ( icalcomponent * comp,
const char * v )

Sets the COMMENT property for the specified icalcomponent.

Parameters
compa pointer to a valid icalcomponent
va pointer to a char string with the COMMENT to use

If comp is invalid then the internal library icalerrno is set to ICAL_MALFORMEDDATA_ERROR.

Definition at line 1833 of file icalcomponent.c.

◆ icalcomponent_set_description()

void icalcomponent_set_description ( icalcomponent * comp,
const char * v )

Sets the DESCRIPTION property for the specified icalcomponent.

Parameters
compa pointer to a valid icalcomponent
va pointer to a char string with the DESCRIPTION to use

If comp is invalid then the internal library icalerrno is set to ICAL_MALFORMEDDATA_ERROR.

Definition at line 1949 of file icalcomponent.c.

◆ icalcomponent_set_dtend()

void icalcomponent_set_dtend ( icalcomponent * comp,
struct icaltimetype v )

Sets the DTEND property for the specified icalcomponent.

This method respects the icaltime type (DATE vs DATE-TIME) and timezone (or lack thereof).

This also checks that a DURATION property isn't already there, and returns an error if it is. It's the caller's responsibility to remove it.

For the icalcomponent routines only, DTEND and DURATION are tied together. If you call this routine and DURATION exists, no action will be taken and icalerrno will be set to ICAL_MALFORMEDDATA_ERROR. If neither exists, the routine will create the appropriate property.

Parameters
compa pointer to a valid icalcomponent
vis the icaltimetype to use

If comp is invalid then the internal library icalerrno is set to ICAL_MALFORMEDDATA_ERROR.

Definition at line 1686 of file icalcomponent.c.

◆ icalcomponent_set_dtstamp()

void icalcomponent_set_dtstamp ( icalcomponent * comp,
struct icaltimetype v )

Sets the DTSTAMP property of an icalcomponent.

Parameters
compa pointer to a valid icalcomponent
vis the icaltimetype to use as the DTSTAMP property

If comp is invalid then the internal library icalerrno is set to ICAL_MALFORMEDDATA_ERROR.

Definition at line 1774 of file icalcomponent.c.

◆ icalcomponent_set_dtstart()

void icalcomponent_set_dtstart ( icalcomponent * comp,
struct icaltimetype v )

Sets the DTSTART property for the specified icalcomponent.

This method respects the icaltime type (DATE vs DATE-TIME) and timezone (or lack thereof).

Parameters
compa pointer to a valid icalcomponent
vis the icaltimetype to use as the DSTART property

If comp is invalid then the internal library icalerrno is set to ICAL_MALFORMEDDATA_ERROR.

Definition at line 1597 of file icalcomponent.c.

◆ icalcomponent_set_due()

void icalcomponent_set_due ( icalcomponent * comp,
struct icaltimetype v )

Sets the due date of a VTODO task.

Parameters
compa pointer to a valid VTODO icalcomponent
va valid due date time.

The DUE and DURATION properties are tied together:

  • If no duration or due properties then sets the DUE property.
  • If a DUE property is already set, then resets it to the value v.
  • If a DURATION property is already set, then calculates the new duration based on the supplied value of v.

If comp is invalid then the internal library icalerrno is set to ICAL_MALFORMEDDATA_ERROR.

Definition at line 2683 of file icalcomponent.c.

◆ icalcomponent_set_duration()

void icalcomponent_set_duration ( icalcomponent * comp,
struct icaldurationtype v )

Sets the DURATION property for the specified icalcomponent.

This method respects the icaltime type (DATE vs DATE-TIME) and timezone (or lack thereof).

This also checks that a DTEND property isn't already there, and returns an error if it is. It's the caller's responsibility to remove it.

For the icalcomponent routines only, DTEND and DURATION are tied together. If you call this routine and DTEND exists, no action will be taken and icalerrno will be set to ICAL_MALFORMEDDATA_ERROR. If neither exists, the routine will create the appropriate property.

Parameters
compa pointer to a valid icalcomponent
vis the icalduration type DURATION to use

If comp is invalid then the internal library icalerrno is set to ICAL_MALFORMEDDATA_ERROR.

Definition at line 1711 of file icalcomponent.c.

◆ icalcomponent_set_iana_name()

void icalcomponent_set_iana_name ( icalcomponent * comp,
const char * name )

Sets the IANA name for an icalcomponent.

Parameters
compa pointer to a valid icalcomponent
namea pointer to char string containing the IANA name.
Since
4.0

Definition at line 364 of file icalcomponent.c.

◆ icalcomponent_set_location()

void icalcomponent_set_location ( icalcomponent * comp,
const char * v )

Sets the LOCATION property for the specified icalcomponent.

Parameters
compa pointer to a valid icalcomponent
va pointer to char string with the LOCATION to use

If comp is invalid then the internal library icalerrno is set to ICAL_MALFORMEDDATA_ERROR.

Definition at line 1984 of file icalcomponent.c.

◆ icalcomponent_set_method()

void icalcomponent_set_method ( icalcomponent * comp,
icalproperty_method method )

Sets the METHOD property of the specified icalcomponent.

Parameters
compa pointer to a valid icalcomponent
methodis the icalproperty_method METHOD property to use

If comp is invalid then the internal library icalerrno is set to ICAL_MALFORMEDDATA_ERROR.

Definition at line 1561 of file icalcomponent.c.

◆ icalcomponent_set_recurrenceid()

void icalcomponent_set_recurrenceid ( icalcomponent * comp,
struct icaltimetype v )

Sets the RECURRENCEID property for the specified icalcomponent.

Parameters
compa pointer to a valid icalcomponent
vis the icaltimetype RECURRENCEID to use

If comp is invalid then the internal library icalerrno is set to ICAL_MALFORMEDDATA_ERROR.

Definition at line 1903 of file icalcomponent.c.

◆ icalcomponent_set_relcalid()

void icalcomponent_set_relcalid ( icalcomponent * comp,
const char * v )

Sets the RELCALID property for the specified icalcomponent.

Parameters
compa pointer to a valid icalcomponent
va pointer to a char string with the RELCALID to use

If comp is invalid then the internal library icalerrno is set to ICAL_MALFORMEDDATA_ERROR.

Definition at line 2628 of file icalcomponent.c.

◆ icalcomponent_set_sequence()

void icalcomponent_set_sequence ( icalcomponent * comp,
int v )

Sets the SEQUENCE property for the specified icalcomponent.

Parameters
compa pointer to a valid icalcomponent
vis the integer SEQUENCE to use

If comp is invalid then the internal library icalerrno is set to ICAL_MALFORMEDDATA_ERROR.

Definition at line 2019 of file icalcomponent.c.

◆ icalcomponent_set_status()

void icalcomponent_set_status ( icalcomponent * comp,
enum icalproperty_status v )

Sets the STATUS for the specified icalcomponent.

Parameters
compa pointer to a valid icalcomponent
vis the icalproperty_status to use as the STATUS property

If comp is invalid then the internal library icalerrno is set to ICAL_MALFORMEDDATA_ERROR.

Definition at line 2054 of file icalcomponent.c.

◆ icalcomponent_set_summary()

void icalcomponent_set_summary ( icalcomponent * comp,
const char * v )

Sets the SUMMARY property for the specified icalcomponent.

Parameters
compa pointer to a valid icalcomponent
va pointer to a char string with the SUMMARY to use

If comp is invalid then the internal library icalerrno is set to ICAL_MALFORMEDDATA_ERROR.

Definition at line 1798 of file icalcomponent.c.

◆ icalcomponent_set_uid()

void icalcomponent_set_uid ( icalcomponent * comp,
const char * v )

Sets the UID property for the specified icalcomponent.

Parameters
compa pointer to a valid icalcomponent
va pointer to a char string with the UID to use

If comp is invalid then the internal library icalerrno is set to ICAL_MALFORMEDDATA_ERROR.

Definition at line 1868 of file icalcomponent.c.

◆ icalcomponent_set_x_name()

void icalcomponent_set_x_name ( icalcomponent * comp,
const char * name )

Sets the X-NAME property for the specified icalcomponent.

Parameters
compa pointer to a valid icalcomponent
namea non-NULL pointer to a char string containing the X-NAME to use.

Definition at line 344 of file icalcomponent.c.

◆ icalcomponent_string_to_kind()

icalcomponent_kind icalcomponent_string_to_kind ( const char * string)

Converts a char string into an icalcomponent_kind.

Parameters
stringa pointer to a char string containing the character representation of an icalcomponent_kind
Returns
the icalcomponent_kind associated with string. ICAL_NO_COMPONENT is returned if string is invalid.

Definition at line 1367 of file icalcomponent.c.

◆ icalcomponent_strip_errors()

void icalcomponent_strip_errors ( icalcomponent * component)

Removes all X-LIC-ERROR properties in an icalcomponent.

Parameters
componenta pointer to a valid icalcomponent

Definition at line 1188 of file icalcomponent.c.

◆ icalcomponent_vanew()

icalcomponent * icalcomponent_vanew ( icalcomponent_kind kind,
... )

Construct a new icalcomponent from a list of icalproperties of icalcomponents.

Free the allocated memory with icalcomponent_free. Make sure to pass NULL (not 0) as the final argument!

Parameters
kindthe icalcomponent_kind of icalcomponent to use
Returns
a pointer to an icalcomponent. NULL .

Definition at line 113 of file icalcomponent.c.

◆ icalproperty_get_datetime_with_component()

struct icaltimetype icalproperty_get_datetime_with_component ( icalproperty * prop,
icalcomponent * comp )

Computes the datetime corresponding to the specified icalproperty and icalcomponent. If the property is a DATE-TIME with a TZID parameter and a corresponding VTIMEZONE is present in the component, the returned component will already be in the correct timezone; otherwise the caller is responsible for converting it.

Call icaltime_is_null_time() on the returned value to detect failures.

Parameters
propa pointer to a valid icalproperty
compa pointer to a valid icalcomponent
Returns
the DATE or DATE_TIME an icaltimetype of the specified icalcomponent.
Since
3.0.5

Definition at line 1072 of file icalproperty.c.

◆ icalproperty_get_parent()

icalcomponent * icalproperty_get_parent ( const icalproperty * property)

Gets the parent icalcomponent for the specified icalproperty.

Parameters
propertya pointer to a valid icalproperty
Returns
a pointer to the parent icalcomponent of the specified icalproperty.

Definition at line 939 of file icalproperty.c.

◆ icalproperty_recurrence_is_excluded()

bool icalproperty_recurrence_is_excluded ( icalcomponent * comp,
struct icaltimetype * dtstart,
struct icaltimetype * recurtime )

Decides if a recurrence is acceptable.

Parameters
compa pointer to a valid icalcomponent
dtstartthe base dtstart value for this component.
recurtimethe time to test against.
Returns
true if the recurrence value is excluded, false otherwise.

This function decides if a specific recurrence value is excluded by EXRULE or EXDATE properties.

It's not the most efficient code. You might get better performance if you assume that recurtime is always increasing for each call. Then you could:

  • sort the EXDATE values
  • save the state of each EXRULE iterator for the next call.

In this case though you don't need to worry how you call this function. It will always return the correct result.

first test against the exdate values

MATCHED

Now test against the EXRULEs

MATCH

exrule_time > recurtime

Definition at line 781 of file icalcomponent.c.

◆ icalproperty_set_parent()

void icalproperty_set_parent ( icalproperty * property,
icalcomponent * component )

Sets the parent icalcomponent for the specified icalproperty.

Parameters
propertya pointer to a valid icalproperty
componenta pointer to a valid icalcomponent to use as the parent
Since
3.0

Definition at line 932 of file icalproperty.c.

◆ icalpropiter_deref()

icalproperty * icalpropiter_deref ( icalpropiter * i)

Gets the current icalproperty referenced by the specified icalpropiter.

Parameters
ia pointer to a valid icalpropiter
Returns
a pointer to the icalproperty associated to i or NULL if i is invalid.

Definition at line 1541 of file icalcomponent.c.

◆ icalpropiter_is_valid()

bool icalpropiter_is_valid ( const icalpropiter * i)

Checks if the specified icalpropiter is valid.

Parameters
ia pointer to a possibly invalid icalpropiter
Returns
true if i points to a valid icalpropiter; false otherwise.
Since
4.0

Definition at line 1513 of file icalcomponent.c.

◆ icalpropiter_next()

icalproperty * icalpropiter_next ( icalpropiter * i)

Gets the next icalproperty referenced by the specified icalpropiter with a matching icalproperty_kind.

Parameters
ia pointer to a valid icalpropiter
Returns
a pointer to the next icalproperty with a matching icalproperty_kind after the one referenced by i. NULL is returned if is invalid or if there are no matches found.

Definition at line 1522 of file icalcomponent.c.