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 librararies 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(register XDR *xdrs, cmcb_cal_attr_data *objp)
50 if (!xdr_array(xdrs, (char **)&objp->names, (u_int *) &objp->num_names,
51 ~0, sizeof (cms_name), (xdrproc_t) xdr_cms_name))
57 * add_entry_data - contain information of the deleted entry
61 xdr_cmcb_add_entry_data(register XDR *xdrs, cmcb_add_entry_data *objp)
66 if (!xdr_string(xdrs, &objp->id, ~0))
72 * delete_entry_data - contain information of the deleted entry
76 xdr_cmcb_delete_entry_data(register XDR *xdrs, cmcb_delete_entry_data *objp)
81 if (!xdr_string(xdrs, &objp->id, ~0))
83 if (!xdr_int(xdrs, &objp->scope))
85 if (!xdr_long(xdrs, &objp->time))
91 * update_entry_data - contain information of the updated entry
92 * if new entry id is not resulted from the update, oldid will be
93 * set to a NULL string ("").
97 xdr_cmcb_update_entry_data(register XDR *xdrs, cmcb_update_entry_data *objp)
102 if (!xdr_string(xdrs, &objp->newid, ~0))
104 if (!xdr_string(xdrs, &objp->oldid, ~0))
106 if (!xdr_int(xdrs, &objp->scope))
108 if (!xdr_long(xdrs, &objp->time))
114 xdr_cmcb_update_data(register XDR *xdrs, cmcb_update_data *objp)
119 if (!xdr_int(xdrs, &objp->reason))
122 switch (objp->reason) {
123 case CSA_CB_CALENDAR_ATTRIBUTE_UPDATED:
124 if (!xdr_pointer(xdrs, (char **)&objp->data.cdata,
125 sizeof (cmcb_cal_attr_data),
126 (xdrproc_t) xdr_cmcb_cal_attr_data))
129 case CSA_CB_ENTRY_ADDED:
130 if (!xdr_pointer(xdrs, (char **)&objp->data.adata,
131 sizeof (cmcb_add_entry_data),
132 (xdrproc_t) xdr_cmcb_add_entry_data))
135 case CSA_CB_ENTRY_DELETED:
136 if (!xdr_pointer(xdrs, (char **)&objp->data.ddata,
137 sizeof (cmcb_delete_entry_data),
138 (xdrproc_t) xdr_cmcb_delete_entry_data))
141 case CSA_CB_ENTRY_UPDATED:
142 if (!xdr_pointer(xdrs, (char **)&objp->data.udata,
143 sizeof (cmcb_update_entry_data),
144 (xdrproc_t) xdr_cmcb_update_entry_data))
152 xdr_cmcb_update_callback_args(register XDR *xdrs, cmcb_update_callback_args *objp)
157 if (!xdr_string(xdrs, &objp->calendar, ~0))
159 if (!xdr_string(xdrs, &objp->user, ~0))
161 if (!xdr_cmcb_update_data(xdrs, &objp->data))