2 * xdr_update.c: Additions to release 3.0 XDR routines required
3 * for rpcgen. These routines are from release 3.2BETA and
4 * may be updated before final release.
6 * Copyright (C) 1986, Sun Microsystems, Inc.
10 #include <afs/param.h>
16 #ifdef NULL /* Strict ANSI-C aborts if we redefine this */
22 #define LASTUNSIGNED ((u_int)0-1)
27 * XDR a pointer to a possibly recursive data structure. This
28 * differs with xdr_reference in that it can serialize/deserialiaze
31 * What's sent is actually a union:
33 * union object_pointer switch (boolean b) {
34 * case TRUE: object_data data;
35 * case FALSE: void nothing;
38 * > objpp: Pointer to the pointer to the object.
39 * > obj_size: size of the object.
40 * > xdr_obj: routine to XDR an object.
44 xdr_pointer(XDR * xdrs, char **objpp, u_int obj_size,
50 more_data = (*objpp != NULL);
51 if (!xdr_bool(xdrs, &more_data)) {
58 return (xdr_reference(xdrs, objpp, obj_size, xdr_obj));
64 * XDR a fixed length array. Unlike variable-length arrays,
65 * the storage of fixed length arrays is static and unfreeable.
66 * > basep: base of the array
67 * > size: size of the array
68 * > elemsize: size of each element
69 * > xdr_elem: routine to XDR each element
72 xdr_vector(XDR * xdrs, char *basep, u_int nelem,
73 u_int elemsize, xdrproc_t xdr_elem)
79 for (i = 0; i < nelem; i++) {
80 if (!(*xdr_elem) (xdrs, elptr, LASTUNSIGNED)) {