Libical API Documentation 3.0

icalduration.h
Go to the documentation of this file.
1/*======================================================================
2 FILE: icalduration.h
3 CREATOR: eric 26 Jan 2001
4
5 (C) COPYRIGHT 2000, Eric Busboom <eric@civicknowledge.com>
6
7 This library is free software; you can redistribute it and/or modify
8 it under the terms of either:
9
10 The LGPL as published by the Free Software Foundation, version
11 2.1, available at: https://www.gnu.org/licenses/lgpl-2.1.html
12
13 Or:
14
15 The Mozilla Public License Version 2.0. You may obtain a copy of
16 the License at https://www.mozilla.org/MPL/
17
18 The Original Code is eric. The Initial Developer of the Original
19 Code is Eric Busboom
20======================================================================*/
21
22#ifndef ICALDURATION_H
23#define ICALDURATION_H
24
30#include "libical_ical_export.h"
31#include "icaltime.h"
32
36 struct icaldurationtype
37{
38 int is_neg;
39 unsigned int days;
40 unsigned int weeks;
41 unsigned int hours;
42 unsigned int minutes;
43 unsigned int seconds;
44};
45
61LIBICAL_ICAL_EXPORT struct icaldurationtype icaldurationtype_from_int(int t);
62
82LIBICAL_ICAL_EXPORT struct icaldurationtype icaldurationtype_from_string(const char *dur);
83
99LIBICAL_ICAL_EXPORT int icaldurationtype_as_int(struct icaldurationtype duration);
100
125LIBICAL_ICAL_EXPORT char *icaldurationtype_as_ical_string(struct icaldurationtype d);
126
147LIBICAL_ICAL_EXPORT char *icaldurationtype_as_ical_string_r(struct icaldurationtype d);
148
170LIBICAL_ICAL_EXPORT struct icaldurationtype icaldurationtype_null_duration(void);
171
187LIBICAL_ICAL_EXPORT struct icaldurationtype icaldurationtype_bad_duration(void);
188
205LIBICAL_ICAL_EXPORT int icaldurationtype_is_null_duration(struct icaldurationtype d);
206
223LIBICAL_ICAL_EXPORT int icaldurationtype_is_bad_duration(struct icaldurationtype d);
224
244LIBICAL_ICAL_EXPORT struct icaltimetype icaltime_add(struct icaltimetype t,
245 struct icaldurationtype d);
246
264LIBICAL_ICAL_EXPORT struct icaldurationtype icaltime_subtract(struct icaltimetype t1,
265 struct icaltimetype t2);
266
267#endif /* !ICALDURATION_H */
icaldurationtype_from_string
struct icaldurationtype icaldurationtype_from_string(const char *dur)
Creates a new icaldurationtype from a duration given as a string.
Definition: icalduration.c:62
icaldurationtype_as_int
int icaldurationtype_as_int(struct icaldurationtype duration)
Converts an icaldurationtype into the duration in seconds as int.
Definition: icalduration.c:270
icaldurationtype_bad_duration
struct icaldurationtype icaldurationtype_bad_duration(void)
Creates a bad duration (used to indicate error).
Definition: icalduration.c:304
icaldurationtype_from_int
struct icaldurationtype icaldurationtype_from_int(int t)
Creates a new icaldurationtype from a duration in seconds.
Definition: icalduration.c:32
icaldurationtype_is_bad_duration
int icaldurationtype_is_bad_duration(struct icaldurationtype d)
Checks if a duration is a bad duration.
Definition: icalduration.c:313
icaltime_subtract
struct icaldurationtype icaltime_subtract(struct icaltimetype t1, struct icaltimetype t2)
Returns the difference between two icaltimetype as a duration.
Definition: icalduration.c:339
icaltime_add
struct icaltimetype icaltime_add(struct icaltimetype t, struct icaldurationtype d)
Adds a duration to an ::icaltime object and returns the result.
Definition: icalduration.c:318
icaldurationtype_as_ical_string_r
char * icaldurationtype_as_ical_string_r(struct icaldurationtype d)
Definition: icalduration.c:220
icaldurationtype_null_duration
struct icaldurationtype icaldurationtype_null_duration(void)
Creates a duration with zero length.
Definition: icalduration.c:279
icaldurationtype_as_ical_string
char * icaldurationtype_as_ical_string(struct icaldurationtype d)
Definition: icalduration.c:211
icaldurationtype_is_null_duration
int icaldurationtype_is_null_duration(struct icaldurationtype d)
Checks if a duration is a null duration.
Definition: icalduration.c:288
icaltime.h
struct icaltimetype is a pseudo-object that abstracts time handling.
icaldurationtype
A struct representing a duration.
Definition: icalduration.h:37
icaltimetype
Definition: icaltime.h:105