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>
17 #ifdef NULL /* Strict ANSI-C aborts if we redefine this */
23 #define LASTUNSIGNED ((u_int)0-1)
28 * XDR a pointer to a possibly recursive data structure. This
29 * differs with xdr_reference in that it can serialize/deserialiaze
32 * What's sent is actually a union:
34 * union object_pointer switch (boolean b) {
35 * case TRUE: object_data data;
36 * case FALSE: void nothing;
39 * > objpp: Pointer to the pointer to the object.
40 * > obj_size: size of the object.
41 * > xdr_obj: routine to XDR an object.
45 xdr_pointer(xdrs,objpp,obj_size,xdr_obj)
54 more_data = (*objpp != NULL);
55 if (! xdr_bool(xdrs,&more_data)) {
62 return(xdr_reference(xdrs,objpp,obj_size,xdr_obj));
68 * XDR a fixed length array. Unlike variable-length arrays,
69 * the storage of fixed length arrays is static and unfreeable.
70 * > basep: base of the array
71 * > size: size of the array
72 * > elemsize: size of each element
73 * > xdr_elem: routine to XDR each element
76 xdr_vector(xdrs, basep, nelem, elemsize, xdr_elem)
80 register u_int elemsize;
81 register xdrproc_t xdr_elem;
87 for (i = 0; i < nelem; i++) {
88 if (! (*xdr_elem)(xdrs, elptr, LASTUNSIGNED)) {