Libical API Documentation 4.0 UNRELEASED Go to the stable 3.0 documentation
Loading...
Searching...
No Matches
icalduration.h
Go to the documentation of this file.
1/*======================================================================
2 FILE: icalduration.h
3 CREATOR: eric 26 Jan 2001
4
5 SPDX-FileCopyrightText: 2000, Eric Busboom <eric@civicknowledge.com>
6 SPDX-License-Identifier: LGPL-2.1-only OR MPL-2.0
7
8 The Original Code is eric. The Initial Developer of the Original
9 Code is Eric Busboom
10======================================================================*/
11
16
17#ifndef ICALDURATION_H
18#define ICALDURATION_H
19
20#include "libical_ical_export.h"
21#include "icaltime.h"
22
23#include <stdbool.h>
24
31 int is_neg;
32 unsigned int days;
33 unsigned int weeks;
34 unsigned int hours;
35 unsigned int minutes;
36 unsigned int seconds;
37};
38
40#define ICALDURATIONTYPE_INITIALIZER {0, 0, 0, 0, 0, 0}
42
65LIBICAL_ICAL_EXPORT struct icaldurationtype icaldurationtype_from_seconds(int seconds);
66
86LIBICAL_ICAL_EXPORT struct icaldurationtype icaldurationtype_from_string(const char *str);
87
115LIBICAL_ICAL_EXPORT int icaldurationtype_as_seconds(struct icaldurationtype duration);
116
128LIBICAL_ICAL_EXPORT int icaldurationtype_as_utc_seconds(struct icaldurationtype duration);
129
154LIBICAL_ICAL_EXPORT char *icaldurationtype_as_ical_string(struct icaldurationtype d);
155
176LIBICAL_ICAL_EXPORT char *icaldurationtype_as_ical_string_r(struct icaldurationtype d);
177
199LIBICAL_ICAL_EXPORT struct icaldurationtype icaldurationtype_null_duration(void);
200
216LIBICAL_ICAL_EXPORT struct icaldurationtype icaldurationtype_bad_duration(void);
217
234LIBICAL_ICAL_EXPORT bool icaldurationtype_is_null_duration(struct icaldurationtype d);
235
252LIBICAL_ICAL_EXPORT bool icaldurationtype_is_bad_duration(struct icaldurationtype d);
253
275LIBICAL_ICAL_EXPORT struct icaltimetype icalduration_extend(struct icaltimetype t,
276 struct icaldurationtype d);
277
297LIBICAL_ICAL_EXPORT struct icaldurationtype icalduration_from_times(struct icaltimetype t1,
298 struct icaltimetype t2);
299
314LIBICAL_ICAL_EXPORT struct icaldurationtype icaldurationtype_normalize(struct icaldurationtype dur);
315
316#endif /* !ICALDURATION_H */
struct icaldurationtype icaldurationtype_bad_duration(void)
Creates a bad duration (used to indicate error).
struct icaldurationtype icalduration_from_times(struct icaltimetype t1, struct icaltimetype t2)
Creates a duration from two icaltimetype endpoints.
struct icaltimetype icalduration_extend(struct icaltimetype t, struct icaldurationtype d)
Extends a time duration.
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.
struct icaldurationtype icaldurationtype_null_duration(void)
Creates a duration with zero length.
struct icaldurationtype icaldurationtype_normalize(struct icaldurationtype dur)
Create a normalized duration from another duration.
int icaldurationtype_as_utc_seconds(struct icaldurationtype duration)
Extracts the duration in integer seconds from an icaldurationtype in UTC time.
int icaldurationtype_as_seconds(struct icaldurationtype duration)
Extracts the duration in integer seconds from an icaldurationtype.
bool icaldurationtype_is_bad_duration(struct icaldurationtype d)
Checks if a duration is a bad duration.
char * icaldurationtype_as_ical_string_r(struct icaldurationtype d)
bool icaldurationtype_is_null_duration(struct icaldurationtype d)
Checks if a duration is a null duration.
char * icaldurationtype_as_ical_string(struct icaldurationtype d)
Defines the data structure for representing date-times.
unsigned int weeks
unsigned int hours
unsigned int seconds
unsigned int days
unsigned int minutes