dtcm: Resolve CID 87713
[oweals/cde.git] / cde / programs / dtcm / server / repeat.h
1 /*
2  * CDE - Common Desktop Environment
3  *
4  * Copyright (c) 1993-2012, The Open Group. All rights reserved.
5  *
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)
10  * any later version.
11  *
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
16  * details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with these librararies and programs; if not, write
20  * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21  * Floor, Boston, MA 02110-1301 USA
22  */
23 /* $XConsortium: repeat.h /main/4 1995/11/09 12:49:18 rswiston $ */
24 /*
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.
29  */
30
31 #ifndef _REPEAT_H
32 #define _REPEAT_H
33
34 #include <EUSCompat.h>
35 #include "ansi_c.h"
36 #include "cm.h"
37 #include "rtable4.h"
38 #include "rerule.h"
39
40 typedef time_t  Tick;
41
42 extern int      monthdays[];
43
44 extern void init_time P(());
45
46 extern time_t _DtCms_closest_tick_v4 P((time_t target,
47                                         time_t ftick,
48                                         Period_4 period,
49                                         int *ordinal));
50
51 extern time_t _DtCms_last_tick_v4 P((time_t ftick,
52                                      Period_4 period,
53                                      int ntimes));
54
55 extern time_t _DtCms_next_tick_v4 P((time_t tick, Period_4 period));
56
57 extern time_t _DtCms_prev_tick_v4 P((time_t tick, Period_4 period));
58
59 extern time_t _DtCms_first_tick_v4 P((time_t t, Period_4 period, int ordinal));
60
61 extern void _DtCms_adjust_appt_startdate P((Appt_4 *appt));
62
63 extern time_t next_nmins P((time_t t, int m));
64
65 extern time_t next_ndays P((time_t t, int n));
66
67 extern int _DtCms_marked_4_cancellation P((Appt_4 *a, int i));
68
69 extern int _DtCms_get_new_ntimes_v4 P((Period_4 period,
70                                        time_t tick,
71                                        int ninstance));
72
73 extern int _DtCms_get_ninstance_v4 P((Appt_4 *appt));
74
75 extern int _DtCms_in_repeater P((Id_4 *key,
76                                  Appt_4 *p_appt,
77                                  boolean_t dont_care_cancel));
78
79 extern int      monthlength             P((Tick));
80 extern int      leapyr                  P((int));
81 extern int      fdom                    P((Tick));
82 extern int      ldom                    P((Tick));
83
84 /*
85  * returns the tick of the beginning of the day
86  */
87 extern time_t _DtCmsBeginOfDay(time_t t);
88
89 /*
90  * return the tick since begin of day
91  */
92 extern time_t _DtCmsTimeOfDay(time_t t);
93
94 /*
95  * routines to deal with recurrence rule and exception dates
96  */
97 extern boolean_t _DtCmsInExceptionList P((cms_entry *eptr, time_t tick));
98
99 #endif