Libical API Documentation 4.0
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
7 SPDX-License-Identifier: LGPL-2.1-only OR MPL-2.0
8
9 The Original Code is eric. The Initial Developer of the Original
10 Code is Eric Busboom
11======================================================================*/
12
13#ifndef ICALDURATION_H
14#define ICALDURATION_H
15
20
21#include "libical_ical_export.h"
22#include "icaltime.h"
23
24#include <stdbool.h>
25
30 int is_neg;
31 unsigned int days;
32 unsigned int weeks;
33 unsigned int hours;
34 unsigned int minutes;
35 unsigned int seconds;
36};
37
38#define ICALDURATIONTYPE_INITIALIZER \
39 { \
40 0, 0, 0, 0, 0, 0}
41
57LIBICAL_ICAL_EXPORT struct icaldurationtype icaldurationtype_from_int(int t);
58
78LIBICAL_ICAL_EXPORT struct icaldurationtype icaldurationtype_from_string(const char *dur);
79
95LIBICAL_ICAL_EXPORT int icaldurationtype_as_int(struct icaldurationtype duration);
96
121LIBICAL_ICAL_EXPORT char *icaldurationtype_as_ical_string(struct icaldurationtype d);
122
143LIBICAL_ICAL_EXPORT char *icaldurationtype_as_ical_string_r(struct icaldurationtype d);
144
166LIBICAL_ICAL_EXPORT struct icaldurationtype icaldurationtype_null_duration(void);
167
183LIBICAL_ICAL_EXPORT struct icaldurationtype icaldurationtype_bad_duration(void);
184
201LIBICAL_ICAL_EXPORT bool icaldurationtype_is_null_duration(struct icaldurationtype d);
202
219LIBICAL_ICAL_EXPORT bool icaldurationtype_is_bad_duration(struct icaldurationtype d);
220
240LIBICAL_ICAL_EXPORT struct icaltimetype icaltime_add(struct icaltimetype t,
241 struct icaldurationtype d);
242
260LIBICAL_ICAL_EXPORT struct icaldurationtype icaltime_subtract(struct icaltimetype t1,
261 struct icaltimetype t2);
262
263#endif /* !ICALDURATION_H */
int icaldurationtype_as_int(struct icaldurationtype duration)
Converts an icaldurationtype into the duration in seconds as int.
Definition icalduration.c:247
bool icaldurationtype_is_bad_duration(struct icaldurationtype d)
Checks if a duration is a bad duration.
Definition icalduration.c:291
char * icaldurationtype_as_ical_string_r(struct icaldurationtype d)
Definition icalduration.c:200
bool icaldurationtype_is_null_duration(struct icaldurationtype d)
Checks if a duration is a null duration.
Definition icalduration.c:266
char * icaldurationtype_as_ical_string(struct icaldurationtype d)
Definition icalduration.c:191
struct icaltimetype is a pseudo-object that abstracts time handling.
A struct representing a duration.
Definition icalduration.h:29
Definition icaltime.h:98