1 /* $XConsortium: cmscalendar.h /main/4 1995/11/09 12:40:57 rswiston $ */
3 * (c) Copyright 1993, 1994 Hewlett-Packard Company
4 * (c) Copyright 1993, 1994 International Business Machines Corp.
5 * (c) Copyright 1993, 1994 Novell, Inc.
6 * (c) Copyright 1993, 1994 Sun Microsystems, Inc.
10 #define _CMSCALENDAR_H
24 #define GET_R_ACCESS(cal) ((Access_Entry_4 *) (cal->r_access))
25 #define SET_R_ACCESS(cal,v) (cal)->r_access = (caddr_t) v
26 #define GET_W_ACCESS(cal) ((Access_Entry_4 *) (cal->w_access))
27 #define SET_W_ACCESS(cal,v) (cal)->w_access = (caddr_t) v
28 #define GET_D_ACCESS(cal) ((Access_Entry_4 *) (cal->d_access))
29 #define SET_D_ACCESS(cal,v) (cal)->d_access = (caddr_t) v
30 #define GET_X_ACCESS(cal) ((Access_Entry_4 *) (cal->x_access))
31 #define SET_X_ACCESS(cal,v) (cal)->x_access = (caddr_t) v
32 #define APPT_TREE(info) ((Rb_tree *) ((info)->tree))
33 #define REPT_LIST(info) ((Hc_list *) ((info)->list))
34 #define APPT_KEY(p_appt) ((Appt_4 *) (p_appt))->appt_id.key
35 #define APPT_TICK(p_appt) ((Appt_4 *) (p_appt))->appt_id.tick
37 typedef CSA_return_code (*_DtCmGetAttrFunc)();
39 typedef struct __DtCmsCalendar {
42 _DtCmNameTable *cal_tbl;
43 _DtCmNameTable *entry_tbl;
44 int *types; /* type associated with entry attrs */
45 int num_entry_attrs; /* number of entry attrs associated
46 * with this calendar */
47 boolean_t hashed; /* true if file converted to hashed
51 boolean_t modified; /* if true, do garbage collection */
52 Rb_tree *tree; /* for single appointments */
53 Hc_list *list; /* for repeating appointments */
54 Rm_que *rm_queue; /* active reminder queue, version 1 */
55 _DtCmsRemQueue *remq; /* reminder queue, version 4 */
56 caddr_t r_access; /* read access, version 1 */
57 caddr_t w_access; /* write access, version 1 */
58 caddr_t d_access; /* delete access, version 1 */
59 caddr_t x_access; /* exec access, version 1 */
60 Access_Entry_4 *alist; /* combined v1 access list */
61 uint num_attrs; /* number of calendar attrs,version 4 */
62 cms_attribute *attrs; /* calendar attributes, version 4 */
63 _DtCmGetAttrFunc *getattrfuncs; /* array of function ptr to get attrs */
64 _DtCmsRegistrationInfo *rlist; /* client registration list */
65 boolean_t *checkowner;
66 struct __DtCmsCalendar *next;
70 extern _DtCmsCalendar * _DtCmsMakeCalendar P((
74 extern void _DtCmsPutInCalList P((_DtCmsCalendar *cal));
76 extern void _DtCmsFreeCalendar P((_DtCmsCalendar *cal));
78 extern CSA_return_code _DtCmsSetFileVersion P((
82 extern CSA_return_code _DtCmsLoadCalendar P((
84 _DtCmsCalendar **cal));
86 extern char * _DtCmsGetCalendarOwner P((char *target));
88 extern CSA_return_code _DtCmsGetCalendarByName P((
91 _DtCmsCalendar **cal));
93 extern CSA_return_code _DtCmsInsertEntry4Parser P((
97 extern void _DtCmsSetAccess4Parser P((
102 extern void _DtCmsSetCalendarAttrs4Parser P((
105 cms_attribute *attrs));
107 extern void _DtCmsGenerateKey P((_DtCmsCalendar *cal, long *key));
109 extern CSA_return_code _DtCmsEnumerateUp P((
111 _DtCmsEnumerateProc doit));
113 extern void _DtCmsEnumerateDown P((
115 _DtCmsEnumerateProc doit));
117 extern CSA_return_code _DtCmsRbToCsaStat P((Rb_Status rb_stat));
119 extern CSA_return_code _DtCmsGetCalAttrsByName P((
122 cms_attr_name *names,
124 cms_attribute **attrs_r));
126 extern CSA_return_code _DtCmsGetAllCalAttrs P((
129 cms_attribute **attrs_r,
130 boolean_t returnall));
132 extern CSA_return_code _DtCmsGetCalAttrNames P((
135 cms_attr_name **names_r));
137 extern void _DtCmsFreeCmsAttrNames P((uint num, cms_attr_name *names));
139 extern CSA_return_code _DtCmsUpdateCalAttributesAndLog P((
142 cms_attribute *srcattrs,
145 extern CSA_return_code _DtCmsV5TransactLog P((