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: cmscalendar.h /main/4 1995/11/09 12:40:57 rswiston $ */
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.
31 #ifndef _CMSCALENDAR_H
32 #define _CMSCALENDAR_H
46 #define GET_R_ACCESS(cal) ((Access_Entry_4 *) (cal->r_access))
47 #define SET_R_ACCESS(cal,v) (cal)->r_access = (caddr_t) v
48 #define GET_W_ACCESS(cal) ((Access_Entry_4 *) (cal->w_access))
49 #define SET_W_ACCESS(cal,v) (cal)->w_access = (caddr_t) v
50 #define GET_D_ACCESS(cal) ((Access_Entry_4 *) (cal->d_access))
51 #define SET_D_ACCESS(cal,v) (cal)->d_access = (caddr_t) v
52 #define GET_X_ACCESS(cal) ((Access_Entry_4 *) (cal->x_access))
53 #define SET_X_ACCESS(cal,v) (cal)->x_access = (caddr_t) v
54 #define APPT_TREE(info) ((Rb_tree *) ((info)->tree))
55 #define REPT_LIST(info) ((Hc_list *) ((info)->list))
56 #define APPT_KEY(p_appt) ((Appt_4 *) (p_appt))->appt_id.key
57 #define APPT_TICK(p_appt) ((Appt_4 *) (p_appt))->appt_id.tick
59 typedef CSA_return_code (*_DtCmGetAttrFunc)();
61 typedef struct __DtCmsCalendar {
64 _DtCmNameTable *cal_tbl;
65 _DtCmNameTable *entry_tbl;
66 int *types; /* type associated with entry attrs */
67 int num_entry_attrs; /* number of entry attrs associated
68 * with this calendar */
69 boolean_t hashed; /* true if file converted to hashed
73 boolean_t modified; /* if true, do garbage collection */
74 Rb_tree *tree; /* for single appointments */
75 Hc_list *list; /* for repeating appointments */
76 Rm_que *rm_queue; /* active reminder queue, version 1 */
77 _DtCmsRemQueue *remq; /* reminder queue, version 4 */
78 caddr_t r_access; /* read access, version 1 */
79 caddr_t w_access; /* write access, version 1 */
80 caddr_t d_access; /* delete access, version 1 */
81 caddr_t x_access; /* exec access, version 1 */
82 Access_Entry_4 *alist; /* combined v1 access list */
83 uint num_attrs; /* number of calendar attrs,version 4 */
84 cms_attribute *attrs; /* calendar attributes, version 4 */
85 _DtCmGetAttrFunc *getattrfuncs; /* array of function ptr to get attrs */
86 _DtCmsRegistrationInfo *rlist; /* client registration list */
87 boolean_t *checkowner;
88 struct __DtCmsCalendar *next;
92 extern _DtCmsCalendar * _DtCmsMakeCalendar P((
96 extern void _DtCmsPutInCalList P((_DtCmsCalendar *cal));
98 extern void _DtCmsFreeCalendar P((_DtCmsCalendar *cal));
100 extern CSA_return_code _DtCmsSetFileVersion P((
104 extern CSA_return_code _DtCmsLoadCalendar P((
106 _DtCmsCalendar **cal));
108 extern char * _DtCmsGetCalendarOwner P((char *target));
110 extern CSA_return_code _DtCmsGetCalendarByName P((
113 _DtCmsCalendar **cal));
115 extern CSA_return_code _DtCmsInsertEntry4Parser P((
119 extern void _DtCmsSetAccess4Parser P((
121 Access_Entry_4 *list,
124 extern void _DtCmsSetCalendarAttrs4Parser P((
127 cms_attribute *attrs));
129 extern void _DtCmsGenerateKey P((_DtCmsCalendar *cal, long *key));
131 extern CSA_return_code _DtCmsEnumerateUp P((
133 _DtCmsEnumerateProc doit));
135 extern void _DtCmsEnumerateDown P((
137 _DtCmsEnumerateProc doit));
139 extern CSA_return_code _DtCmsRbToCsaStat P((Rb_Status rb_stat));
141 extern CSA_return_code _DtCmsGetCalAttrsByName P((
144 cms_attr_name *names,
146 cms_attribute **attrs_r));
148 extern CSA_return_code _DtCmsGetAllCalAttrs P((
151 cms_attribute **attrs_r,
152 boolean_t returnall));
154 extern CSA_return_code _DtCmsGetCalAttrNames P((
157 cms_attr_name **names_r));
159 extern void _DtCmsFreeCmsAttrNames P((uint num, cms_attr_name *names));
161 extern CSA_return_code _DtCmsUpdateCalAttributesAndLog P((
164 cms_attribute *srcattrs,
167 extern CSA_return_code _DtCmsV5TransactLog P((