Initial import of the CDE 2.1.30 sources from the Open Group.
[oweals/cde.git] / cde / lib / csa / cmcb.h
1 /* $XConsortium: cmcb.h /main/1 1996/04/21 19:21:59 drk $ */
2 /*
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.
7  */
8
9 #ifndef _CMCB_H
10 #define _CMCB_H
11
12 #ifndef SunOS
13 #include <rpc/types.h>
14 #endif
15
16 #include <rpc/rpc.h>
17
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21
22
23 #include "csa.h"
24 #include "cm.h"
25
26 /*
27  * cal_attr_data - contain names of calendar attributes updated
28  */
29
30 struct cmcb_cal_attr_data {
31         u_int num_names;
32         cms_name *names;
33 };
34 typedef struct cmcb_cal_attr_data cmcb_cal_attr_data;
35
36 /*
37  * add_entry_data - contain information of the deleted entry
38  */
39
40 struct cmcb_add_entry_data {
41         char *id;
42 };
43 typedef struct cmcb_add_entry_data cmcb_add_entry_data;
44
45 /*
46  * delete_entry_data - contain information of the deleted entry
47  */
48
49 struct cmcb_delete_entry_data {
50         char *id;
51         int scope;
52         long time;
53 };
54 typedef struct cmcb_delete_entry_data cmcb_delete_entry_data;
55
56 /*
57  * update_entry_data - contain information of the updated entry
58  * if new entry id is not resulted from the update, oldid will be
59  * set to a NULL string ("").
60  */
61
62 struct cmcb_update_entry_data {
63         char *newid;
64         char *oldid;
65         int scope;
66         long time;
67 };
68 typedef struct cmcb_update_entry_data cmcb_update_entry_data;
69
70 /*
71  * update_data - contains the update reason and specific information
72  * about the update.  No additional data is provided for CSA_CALENDAR_LOGON,
73  * CSA_CALENDAR_DELETED, and CSA_CALENDAR_ATTRIBUTE_UPDATED
74  */
75 struct cmcb_update_data {
76         int     reason;
77         union {
78                 cmcb_cal_attr_data      *cdata; /* data for cal attrs update */
79                 cmcb_add_entry_data     *adata; /* data for CSA_ENTRY_ADDED */
80                 cmcb_delete_entry_data  *ddata; /* data for CSA_ENTRY_DELETED */
81                 cmcb_update_entry_data  *udata; /* data for CSA_ENTRY_UPDATED */
82         } data;
83 };
84 typedef struct cmcb_update_data cmcb_update_data;
85
86 struct cmcb_update_callback_args {
87         char *calendar;
88         char *user;
89         cmcb_update_data data;
90 };
91 typedef struct cmcb_update_callback_args cmcb_update_callback_args;
92
93 #define AGENTVERS_2 ((unsigned long)(2))
94
95 #if defined(__STDC__) || defined(__cplusplus)
96 #define CMCB_UPDATE_CALLBACK ((unsigned long)(1))
97 extern  void * cmcb_update_callback_2(cmcb_update_callback_args *, CLIENT *);
98 extern  void * cmcb_update_callback_2_svc(cmcb_update_callback_args *, struct svc_req *);
99 extern int agentprog_2_freeresult(SVCXPRT *, xdrproc_t, caddr_t);
100
101 #else /* K&R C */
102 #define CMCB_UPDATE_CALLBACK ((unsigned long)(1))
103 extern  void * cmcb_update_callback_2();
104 extern  void * cmcb_update_callback_2_svc();
105 extern int agentprog_2_freeresult();
106 #endif /* K&R C */
107
108 /* the xdr functions */
109
110 #if defined(__STDC__) || defined(__cplusplus)
111 extern  bool_t xdr_cmcb_cal_attr_data(XDR *, cmcb_cal_attr_data*);
112 extern  bool_t xdr_cmcb_add_entry_data(XDR *, cmcb_add_entry_data*);
113 extern  bool_t xdr_cmcb_delete_entry_data(XDR *, cmcb_delete_entry_data*);
114 extern  bool_t xdr_cmcb_update_entry_data(XDR *, cmcb_update_entry_data*);
115 extern  bool_t xdr_cmcb_update_data(XDR *, cmcb_update_data*);
116 extern  bool_t xdr_cmcb_update_callback_args(XDR *, cmcb_update_callback_args*);
117
118 #else /* K&R C */
119 extern bool_t xdr_cmcb_cal_attr_data();
120 extern bool_t xdr_cmcb_add_entry_data();
121 extern bool_t xdr_cmcb_delete_entry_data();
122 extern bool_t xdr_cmcb_update_entry_data();
123 extern bool_t xdr_cmcb_update_data();
124 extern bool_t xdr_cmcb_update_callback_args();
125
126 #endif /* K&R C */
127
128 #ifdef __cplusplus
129 }
130 #endif
131
132 #ifdef HPUX
133 #undef hpux
134 #define hpux
135 #endif
136 #endif
137