summaryrefslogtreecommitdiffabout
path: root/libical/src/libical/icalrecur.h
Unidiff
Diffstat (limited to 'libical/src/libical/icalrecur.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libical/src/libical/icalrecur.h71
1 files changed, 48 insertions, 23 deletions
diff --git a/libical/src/libical/icalrecur.h b/libical/src/libical/icalrecur.h
index 5fcdc15..5f6ac55 100644
--- a/libical/src/libical/icalrecur.h
+++ b/libical/src/libical/icalrecur.h
@@ -18,2 +18,7 @@
18 the License at http://www.mozilla.org/MPL/ 18 the License at http://www.mozilla.org/MPL/
19*/
20
21/**
22@file icalrecur.h
23@brief Routines for dealing with recurring time
19 24
@@ -22,2 +27,4 @@ How to use:
221) Get a rule and a start time from a component 271) Get a rule and a start time from a component
28
29@code
23 icalproperty rrule; 30 icalproperty rrule;
@@ -29,12 +36,21 @@ How to use:
29 start = icalproperty_get_dtstart(dtstart); 36 start = icalproperty_get_dtstart(dtstart);
37@endcode
30 38
31Or, just make them up: 39Or, just make them up:
40
41@code
32 recur = icalrecurrencetype_from_string("FREQ=YEARLY;BYDAY=SU,WE"); 42 recur = icalrecurrencetype_from_string("FREQ=YEARLY;BYDAY=SU,WE");
33 dtstart = icaltime_from_string("19970101T123000") 43 dtstart = icaltime_from_string("19970101T123000")
44@endcode
34 45
352) Create an iterator 462) Create an iterator
47
48@code
36 icalrecur_iterator* ritr; 49 icalrecur_iterator* ritr;
37 ritr = icalrecur_iterator_new(recur,start); 50 ritr = icalrecur_iterator_new(recur,start);
51@endcode
38 52
393) Iterator over the occurrences 533) Iterator over the occurrences
54
55@code
40 struct icaltimetype next; 56 struct icaltimetype next;
@@ -44,2 +60,3 @@ Or, just make them up:
44 } 60 }
61@endcode
45 62
@@ -48,3 +65,3 @@ whatever timezone that dtstart is in.
48 65
49======================================================================*/ 66*/
50 67
@@ -56,5 +73,5 @@ whatever timezone that dtstart is in.
56 73
57/*********************************************************************** 74/*
58 * Recurrance enumerations 75 * Recurrance enumerations
59**********************************************************************/ 76 */
60 77
@@ -95,3 +112,5 @@ enum {
95 112
96/********************** Recurrence type routines **************/ 113/**
114 * Recurrence type routines
115 */
97 116
@@ -110,3 +129,3 @@ enum {
110 129
111/* Main struct for holding digested recurrence rules */ 130/** Main struct for holding digested recurrence rules */
112struct icalrecurrencetype 131struct icalrecurrencetype
@@ -147,19 +166,21 @@ void icalrecurrencetype_clear(struct icalrecurrencetype *r);
147 166
148/* The 'day' element of the by_day array is encoded to allow 167/**
149representation of both the day of the week ( Monday, Tueday), but also 168 * Array Encoding
150the Nth day of the week ( First tuesday of the month, last thursday of 169 *
151the year) These routines decode the day values */ 170 * The 'day' element of the by_day array is encoded to allow
171 * representation of both the day of the week ( Monday, Tueday), but also
172 * the Nth day of the week ( First tuesday of the month, last thursday of
173 * the year) These routines decode the day values
174 */
152 175
153/* 1 == Monday, etc. */ 176/** 1 == Monday, etc. */
154enum icalrecurrencetype_weekday icalrecurrencetype_day_day_of_week(short day); 177enum icalrecurrencetype_weekday icalrecurrencetype_day_day_of_week(short day);
155 178
156/* 0 == any of day of week. 1 == first, 2 = second, -2 == second to last, etc */ 179/** 0 == any of day of week. 1 == first, 2 = second, -2 == second to last, etc */
157short icalrecurrencetype_day_position(short day); 180int icalrecurrencetype_day_position(short day);
158 181
159 182
160/*********************************************************************** 183/** Recurrance rule parser */
161 * Recurrance rule parser
162**********************************************************************/
163 184
164/* Convert between strings ans recurrencetype structures. */ 185/** Convert between strings and recurrencetype structures. */
165struct icalrecurrencetype icalrecurrencetype_from_string(const char* str); 186struct icalrecurrencetype icalrecurrencetype_from_string(const char* str);
@@ -168,7 +189,7 @@ char* icalrecurrencetype_as_string(struct icalrecurrencetype *recur);
168 189
169/********** recurrence iteration routines ********************/ 190/** Recurrence iteration routines */
170 191
171typedef void icalrecur_iterator; 192typedef struct icalrecur_iterator_impl icalrecur_iterator;
172 193
173/* Create a new recurrence rule iterator */ 194/** Create a new recurrence rule iterator */
174icalrecur_iterator* icalrecur_iterator_new(struct icalrecurrencetype rule, 195icalrecur_iterator* icalrecur_iterator_new(struct icalrecurrencetype rule,
@@ -176,10 +197,14 @@ icalrecur_iterator* icalrecur_iterator_new(struct icalrecurrencetype rule,
176 197
177/* Get the next occurrence from an iterator */ 198/** Get the next occurrence from an iterator */
178struct icaltimetype icalrecur_iterator_next(icalrecur_iterator*); 199struct icaltimetype icalrecur_iterator_next(icalrecur_iterator*);
179 200
180/* Free the iterator */ 201void icalrecur_iterator_decrement_count(icalrecur_iterator*);
202
203/** Free the iterator */
181void icalrecur_iterator_free(icalrecur_iterator*); 204void icalrecur_iterator_free(icalrecur_iterator*);
182 205
183/* Fills array up with at most 'count' time_t values, each 206/**
184 representing an occurrence time in seconds past the POSIX epoch */ 207 * Fills array up with at most 'count' time_t values, each
208 * representing an occurrence time in seconds past the POSIX epoch
209 */
185int icalrecur_expand_recurrence(char* rule, time_t start, 210int icalrecur_expand_recurrence(char* rule, time_t start,