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: cmcbxdr.c /main/1 1996/04/21 19:22:05 drk $ */
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.
32 * xdr routines for v2 callback protocol data structures
35 #include <EUSCompat.h>
41 * cal_attr_data - contain names of calendar attributes updated
45 xdr_cmcb_cal_attr_data(XDR *xdrs, cmcb_cal_attr_data *objp)
47 if (!xdr_array(xdrs, (char **)&objp->names, (u_int *) &objp->num_names,
48 ~0, sizeof (cms_name), (xdrproc_t) xdr_cms_name))
54 * add_entry_data - contain information of the deleted entry
58 xdr_cmcb_add_entry_data(XDR *xdrs, cmcb_add_entry_data *objp)
60 if (!xdr_string(xdrs, &objp->id, ~0))
66 * delete_entry_data - contain information of the deleted entry
70 xdr_cmcb_delete_entry_data(XDR *xdrs, cmcb_delete_entry_data *objp)
72 if (!xdr_string(xdrs, &objp->id, ~0))
74 if (!xdr_int(xdrs, &objp->scope))
76 if (!xdr_long(xdrs, &objp->time))
82 * update_entry_data - contain information of the updated entry
83 * if new entry id is not resulted from the update, oldid will be
84 * set to a NULL string ("").
88 xdr_cmcb_update_entry_data(XDR *xdrs, cmcb_update_entry_data *objp)
90 if (!xdr_string(xdrs, &objp->newid, ~0))
92 if (!xdr_string(xdrs, &objp->oldid, ~0))
94 if (!xdr_int(xdrs, &objp->scope))
96 if (!xdr_long(xdrs, &objp->time))
102 xdr_cmcb_update_data(XDR *xdrs, cmcb_update_data *objp)
104 if (!xdr_int(xdrs, &objp->reason))
107 switch (objp->reason) {
108 case CSA_CB_CALENDAR_ATTRIBUTE_UPDATED:
109 if (!xdr_pointer(xdrs, (char **)&objp->data.cdata,
110 sizeof (cmcb_cal_attr_data),
111 (xdrproc_t) xdr_cmcb_cal_attr_data))
114 case CSA_CB_ENTRY_ADDED:
115 if (!xdr_pointer(xdrs, (char **)&objp->data.adata,
116 sizeof (cmcb_add_entry_data),
117 (xdrproc_t) xdr_cmcb_add_entry_data))
120 case CSA_CB_ENTRY_DELETED:
121 if (!xdr_pointer(xdrs, (char **)&objp->data.ddata,
122 sizeof (cmcb_delete_entry_data),
123 (xdrproc_t) xdr_cmcb_delete_entry_data))
126 case CSA_CB_ENTRY_UPDATED:
127 if (!xdr_pointer(xdrs, (char **)&objp->data.udata,
128 sizeof (cmcb_update_entry_data),
129 (xdrproc_t) xdr_cmcb_update_entry_data))
137 xdr_cmcb_update_callback_args(XDR *xdrs, cmcb_update_callback_args *objp)
139 if (!xdr_string(xdrs, &objp->calendar, ~0))
141 if (!xdr_string(xdrs, &objp->user, ~0))
143 if (!xdr_cmcb_update_data(xdrs, &objp->data))