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