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
12#ifndef ICALDURATION_H
13#define ICALDURATION_H
14
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
39#define ICALDURATIONTYPE_INITIALIZER \
40 { \
41 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
111LIBICAL_ICAL_EXPORT int icaldurationtype_as_seconds(struct icaldurationtype duration);
112
124LIBICAL_ICAL_EXPORT int icaldurationtype_as_utc_seconds(struct icaldurationtype duration);
125
150LIBICAL_ICAL_EXPORT char *icaldurationtype_as_ical_string(struct icaldurationtype d);
151
172LIBICAL_ICAL_EXPORT char *icaldurationtype_as_ical_string_r(struct icaldurationtype d);
173
195LIBICAL_ICAL_EXPORT struct icaldurationtype icaldurationtype_null_duration(void);
196
212LIBICAL_ICAL_EXPORT struct icaldurationtype icaldurationtype_bad_duration(void);
213
230LIBICAL_ICAL_EXPORT bool icaldurationtype_is_null_duration(struct icaldurationtype d);
231
248LIBICAL_ICAL_EXPORT bool icaldurationtype_is_bad_duration(struct icaldurationtype d);
249
271LIBICAL_ICAL_EXPORT struct icaltimetype icalduration_extend(struct icaltimetype t,
272 struct icaldurationtype d);
273
293LIBICAL_ICAL_EXPORT struct icaldurationtype icalduration_from_times(struct icaltimetype t1,
294 struct icaltimetype t2);
295
308LIBICAL_ICAL_EXPORT struct icaldurationtype icaldurationtype_normalize(struct icaldurationtype dur);
309
310#endif /* !ICALDURATION_H */
int icaldurationtype_as_utc_seconds(struct icaldurationtype duration)
Extracts the duration in integer seconds from an icaldurationtype in UTC time.
Definition icalduration.c:246
int icaldurationtype_as_seconds(struct icaldurationtype duration)
Extracts the duration in integer seconds from an icaldurationtype.
Definition icalduration.c:233
bool icaldurationtype_is_bad_duration(struct icaldurationtype d)
Checks if a duration is a bad duration.
Definition icalduration.c:287
char * icaldurationtype_as_ical_string_r(struct icaldurationtype d)
Definition icalduration.c:185
bool icaldurationtype_is_null_duration(struct icaldurationtype d)
Checks if a duration is a null duration.
Definition icalduration.c:265
char * icaldurationtype_as_ical_string(struct icaldurationtype d)
Definition icalduration.c:176
struct icaltimetype is a pseudo-object that abstracts time handling.
A struct representing a duration.
Definition icalduration.h:30
Definition icaltime.h:96