|
Libical API Documentation 4.0 UNRELEASED Go to the stable 3.0 documentation
|
Implements the data structure for time durations. More...
Go to the source code of this file.
Functions | |
| struct icaltimetype | icalduration_extend (struct icaltimetype t, struct icaldurationtype d) |
| Extends a time duration. | |
| struct icaldurationtype | icalduration_from_times (struct icaltimetype t1, struct icaltimetype t2) |
| Creates a duration from two icaltimetype endpoints. | |
| char * | icaldurationtype_as_ical_string (struct icaldurationtype d) |
| char * | icaldurationtype_as_ical_string_r (struct icaldurationtype d) |
| int | icaldurationtype_as_seconds (struct icaldurationtype dur) |
| Extracts the duration in integer seconds from an icaldurationtype. | |
| int | icaldurationtype_as_utc_seconds (struct icaldurationtype dur) |
| Extracts the duration in integer seconds from an icaldurationtype in UTC time. | |
| struct icaldurationtype | icaldurationtype_bad_duration (void) |
| Creates a bad duration (used to indicate error). | |
| struct icaldurationtype | icaldurationtype_from_seconds (int seconds) |
| Creates a new icaldurationtype from a duration in seconds. | |
| struct icaldurationtype | icaldurationtype_from_string (const char *str) |
| Creates a new icaldurationtype from a duration given as a string. | |
| bool | icaldurationtype_is_bad_duration (struct icaldurationtype d) |
| Checks if a duration is a bad duration. | |
| bool | icaldurationtype_is_null_duration (struct icaldurationtype d) |
| Checks if a duration is a null duration. | |
| struct icaldurationtype | icaldurationtype_normalize (struct icaldurationtype dur) |
| Create a normalized duration from another duration. | |
| struct icaldurationtype | icaldurationtype_null_duration (void) |
| Creates a duration with zero length. | |
Implements the data structure for time durations.
Definition in file icalduration.c.
| struct icaltimetype icalduration_extend | ( | struct icaltimetype | t, |
| struct icaldurationtype | d ) |
Extends a time duration.
| t | The time object to add the duration to |
| d | The duration to add to the time object |
Definition at line 297 of file icalduration.c.
| struct icaldurationtype icalduration_from_times | ( | struct icaltimetype | t1, |
| struct icaltimetype | t2 ) |
Creates a duration from two icaltimetype endpoints.
| t1 | The first point in time |
| t2 | The second point in time |
Definition at line 346 of file icalduration.c.
| char * icaldurationtype_as_ical_string | ( | struct icaldurationtype | d | ) |
Converts an icaldurationtype into the iCal format as string.
| d | is the icaldurationtype to convert to iCal format |
d in iCal format Definition at line 181 of file icalduration.c.
| char * icaldurationtype_as_ical_string_r | ( | struct icaldurationtype | d | ) |
Converts an icaldurationtype into the iCal format as string.
| d | is the icaldurationtype to convert to iCal format |
d in iCal format Definition at line 190 of file icalduration.c.
| int icaldurationtype_as_seconds | ( | struct icaldurationtype | duration | ) |
Extracts the duration in integer seconds from an icaldurationtype.
Does not consider negative durations. Does not support days and weeks.
| duration | A valid duration type. |
The number of seconds returned from the specified icaldurationtype can be a positive or negative integer depending if the duration points forward or backward in time.
Additionally, a icaldurationtype that has a non-zero days or weeks value is considered an error. ie. only the icaldurationtype seconds, minutes and hours structure members are converted. Also
Definition at line 238 of file icalduration.c.
| int icaldurationtype_as_utc_seconds | ( | struct icaldurationtype | duration | ) |
Extracts the duration in integer seconds from an icaldurationtype in UTC time.
| duration | A valid duration type. |
The number of seconds returned from the specified icaldurationtype can be a positive or negative integer depending if the duration points forward or backward in time.
Days are fixed to have 24 hours.
Definition at line 251 of file icalduration.c.
| struct icaldurationtype icaldurationtype_bad_duration | ( | void | ) |
Creates a bad duration (used to indicate error).
Definition at line 283 of file icalduration.c.
| struct icaldurationtype icaldurationtype_from_seconds | ( | int | seconds | ) |
Creates a new icaldurationtype from a duration in seconds.
| seconds | The duration in seconds |
The number of seconds stored in the icaldurationtype structure is always a positive integer. If the seconds argument is negative, then the is_neg structure member is set to 1 (true).
Also note that the number of seconds is not in any way refactored into days, hours, or minutes. This function simply assigns the icaldurationtype seconds structure member from the integer provided.
Definition at line 28 of file icalduration.c.
| struct icaldurationtype icaldurationtype_from_string | ( | const char * | str | ) |
Creates a new icaldurationtype from a duration given as a string.
| str | The duration as a string |
Definition at line 43 of file icalduration.c.
| bool icaldurationtype_is_bad_duration | ( | struct icaldurationtype | d | ) |
Checks if a duration is a bad duration.
| d | The duration to check |
Definition at line 292 of file icalduration.c.
| bool icaldurationtype_is_null_duration | ( | struct icaldurationtype | d | ) |
Checks if a duration is a null duration.
| d | The duration to check |
Definition at line 270 of file icalduration.c.
| struct icaldurationtype icaldurationtype_normalize | ( | struct icaldurationtype | dur | ) |
Create a normalized duration from another duration.
Extracts the duration in seconds from an icalduration a continuous timeline with 24-hour days. Supports days, weeks, and negative durations.
| dur | The duration from which to create a normalized duration. |
A duration is normalized such that:
Definition at line 369 of file icalduration.c.
| struct icaldurationtype icaldurationtype_null_duration | ( | void | ) |
Creates a duration with zero length.
Definition at line 261 of file icalduration.c.