|
Libical API Documentation 4.0 UNRELEASED Go to the stable 3.0 documentation
|
Methods for working with durations in iCal. More...
Go to the source code of this file.
Data Structures | |
| struct | icaldurationtype |
| A struct representing a duration. More... | |
Macros | |
| #define | ICALDURATIONTYPE_INITIALIZER |
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 duration) |
| Extracts the duration in integer seconds from an icaldurationtype. | |
| int | icaldurationtype_as_utc_seconds (struct icaldurationtype duration) |
| 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. | |
Methods for working with durations in iCal.
| #define ICALDURATIONTYPE_INITIALIZER |
| 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 |
| 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 |
| 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 | 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 | int icaldurationtype_as_seconds | ( | struct icaldurationtype | duration | ) |
Extracts the duration in integer seconds from an icaldurationtype.
| 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
| 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.
| 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.
| 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.
| 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 |
| bool icaldurationtype_is_bad_duration | ( | struct icaldurationtype | d | ) |
Checks if a duration is a bad duration.
| d | The duration to check |
| bool icaldurationtype_is_null_duration | ( | struct icaldurationtype | d | ) |
Checks if a duration is a null duration.
| d | The duration to check |
| struct icaldurationtype icaldurationtype_normalize | ( | struct icaldurationtype | dur | ) |
Create a normalized duration from another duration.
| dur | The duration of which to create a normalized copy from. |
A duration is normalized such that:
| struct icaldurationtype icaldurationtype_null_duration | ( | void | ) |
Creates a duration with zero length.