2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these libraries and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
23 /* $XConsortium: rerule.h /main/1 1996/04/21 19:24:15 drk $ */
25 * (c) Copyright 1993, 1994 Hewlett-Packard Company
26 * (c) Copyright 1993, 1994 International Business Machines Corp.
27 * (c) Copyright 1993, 1994 Novell, Inc.
28 * (c) Copyright 1993, 1994 Sun Microsystems, Inc.
34 typedef unsigned long Time;
35 typedef unsigned int Interval;
38 #define RE_INFINITY -1
43 #define RE_STOP_FLAG 0x80000000
44 #define RE_SET_FLAG(data) (data |= RE_STOP_FLAG)
45 #define RE_STOP_IS_SET(data) (data & RE_STOP_FLAG)
46 #define RE_MASK_STOP(data) (data & ~RE_STOP_FLAG)
86 typedef struct _NumberList {
87 struct _NumberList *nl_next;
88 unsigned int nl_number;
91 typedef struct _DayTime {
93 unsigned int dt_ntime;
97 typedef struct _DayTimeList {
98 struct _DayTimeList *dtl_next;
102 typedef struct _WeekDayTime {
103 unsigned int wdt_nday;
105 unsigned int wdt_ntime;
107 unsigned int wdt_nweek;
108 WeekNumber *wdt_week;
111 typedef struct _WeekDayTimeList {
112 struct _WeekDayTimeList *wdtl_next;
113 WeekDayTime *wdtl_weektime;
116 typedef struct _DailyData {
117 unsigned int dd_ntime;
121 typedef struct _WeeklyData {
122 unsigned int wd_ndaytime;
126 typedef struct _MonthlyData {
127 unsigned int md_nitems; /* # of md_weektime or md_days */
128 WeekDayTime *md_weektime; /* Used in MP command */
129 unsigned int *md_days; /* Array of days for MD command */
132 typedef struct _YearlyData {
133 unsigned int yd_nitems;
134 unsigned int *yd_items; /* Array of days/months event occurs */
137 typedef struct _RepeatEvent {
138 struct _RepeatEvent *re_next;
139 struct _RepeatEvent *re_prev;
140 Interval re_interval;
141 Duration re_duration;
146 WeeklyData *re_weekly;
147 MonthlyData *re_monthly;
148 YearlyData *re_yearly;
152 typedef struct _RepeatEventState {
153 struct _RepeatEventState *res_next;
154 const RepeatEvent *res_re;
155 Duration res_duration; /* # events remaining */
158 unsigned int res_time;
160 struct _WeeklyState {
161 unsigned int res_daytime;
162 unsigned int res_time;
164 struct _MonthlyState {
165 unsigned int res_day;
166 unsigned int res_weektime;
167 unsigned int res_wday;
168 unsigned int res_wtime;
169 unsigned int res_wweek;
171 struct _YearlyState {
172 unsigned int res_daymonth;
177 extern void _DtCm_free_re(RepeatEvent *);
178 extern void _DtCm_free_re_state(RepeatEventState *);
180 #endif /* _RERULE_H */