dtcm: Resolve CID 87822
[oweals/cde.git] / cde / programs / dtcm / server / v4ops.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: v4ops.h /main/4 1995/11/09 12:55:26 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 _V4OPS_H
32 #define _V4OPS_H
33
34 #include "ansi_c.h"
35 #include "rtable4.h"
36 #include "cm.h"
37 #include "log.h"
38 #include "cmscalendar.h"
39
40 #define is_appointment(p_appt)          ((p_appt)->period.period == single_4)
41 #define is_repeater(p_appt)             ((p_appt)->period.period != single_4)
42
43 typedef struct __DtCmsEntryId {
44         long id;
45         struct __DtCmsEntryId *next;
46 } _DtCmsEntryId;
47
48 extern CSA_return_code _DtCmsInsertAppt P((_DtCmsCalendar *cal, Appt_4 *appt4));
49
50 extern CSA_return_code _DtCmsDeleteAppt P((
51                         _DtCmsCalendar  *cal,
52                         char            *user,
53                         uint            access,
54                         Id_4            *p_key,
55                         Appt_4          **appt_r));
56
57 extern CSA_return_code _DtCmsDeleteApptAndLog P((
58                         _DtCmsCalendar  *cal,
59                         char            *user,
60                         uint            access,
61                         Id_4            *key,
62                         Appt_4          **oldappt));
63
64 extern CSA_return_code _DtCmsDeleteApptInstancesAndLog P((
65                         _DtCmsCalendar  *cal,
66                         char            *source,
67                         uint            access,
68                         Id_4            *key,
69                         Options_4       option,
70                         int             *remain,
71                         Appt_4          **oldappt));
72
73 extern CSA_return_code _DtCmsChangeAll P((
74                         _DtCmsCalendar  *cal,
75                         char            *source,
76                         uint            access,
77                         Id_4            *p_key,
78                         Appt_4          *newa,
79                         Appt_4          **oldappt));
80
81 extern CSA_return_code _DtCmsChangeSome P((
82                         _DtCmsCalendar  *cal,
83                         char            *source,
84                         uint            access,
85                         Id_4            *p_key,
86                         Appt_4          *p_appt,
87                         Options_4       option,
88                         Appt_4          **oldappt));
89
90 extern CSA_return_code _DtCmsInsertApptAndLog P((
91                         _DtCmsCalendar  *cal,
92                         Appt_4          *appt));
93
94 extern _DtCmsComparisonResult _DtCmsCompareAppt P((Id_4 *key, caddr_t data));
95
96 extern _DtCmsComparisonResult _DtCmsCompareRptAppt P((Id_4 *key, caddr_t data));
97
98 extern caddr_t _DtCmsGetApptKey P((caddr_t data));
99
100 extern CSA_return_code v4_transact_log P((
101                         char            *calendar,
102                         Appt_4          *a,
103                         _DtCmsLogOps    op));
104
105 extern CSA_return_code _DtCmsLookupRangeV4 P((
106                         _DtCmsCalendar  *cal,
107                         char            *user,
108                         uint            access,
109                         Range_4         *p_range,
110                         boolean_t       no_end_time_range,
111                         long            end1,
112                         long            end2,
113                         boolean_t       (*match_func)(),
114                         uint            num_attrs,
115                         cms_attribute   *attrs,
116                         CSA_enum        *ops,
117                         Appt_4          **appt_r,
118                         Abb_Appt_4      **abbr_r));
119
120 extern CSA_return_code _DtCmsLookupKeyrangeV4 P((
121                         _DtCmsCalendar  *cal,
122                         char            *user,
123                         uint            access,
124                         boolean_t       no_start_time_range,
125                         boolean_t       no_end_time_range,
126                         time_t          start1,
127                         time_t          start2,
128                         time_t          end1,
129                         time_t          end2,
130                         long            id,
131                         boolean_t       (*match_func)(),
132                         uint            num_attrs,
133                         cms_attribute   *attrs,
134                         CSA_enum        *ops,
135                         Appt_4          **appt_r,
136                         Abb_Appt_4      **abbr_r));
137
138 extern CSA_return_code _AddToLinkedAppts P((
139                         Appt_4  *p_appt,
140                         char    *user,
141                         uint    access,
142                         caddr_t *ilp));
143
144 extern CSA_return_code _AddToLinkedAbbrAppts P((
145                         Appt_4  *p_appt,
146                         char    *user,
147                         uint    access,
148                         caddr_t *ilp));
149
150 extern Privacy_Level_4 _GetAccessLevel P((
151                         char    *user,
152                         uint    access,
153                         Appt_4  *p_appt));
154
155 extern Appt_4 * _AddApptInOrder P((Appt_4 * head, Appt_4 * aptr));
156
157 extern Abb_Appt_4 * _AddAbbApptInOrder P((Abb_Appt_4 *head, Abb_Appt_4 *aptr));
158
159 extern CSA_return_code _DtCmsSetV4AccessListAndLog P((
160                         _DtCmsCalendar  *cal,
161                         Access_Entry_4  *alist));
162
163 extern CSA_return_code _DtCmsGetV4Reminders P((
164                         _DtCmsCalendar  *cal,
165                         long            tick,
166                         Reminder_4      **rem_r,
167                         _DtCmsEntryId   **ids_r));
168
169 extern void _DtCmsFreeEntryIds P((_DtCmsEntryId *ids));
170
171 extern CSA_return_code _DtCmsTruncateElist P((
172                         Appt_4          *parent_p,
173                         int             remain,
174                         Except_4        **excpt));
175
176 extern CSA_return_code _DtCmsSetV4AccessListInCal P((
177                         _DtCmsCalendar *cal,
178                         Access_Entry_4 *e));
179
180 #endif