diff options
Diffstat (limited to 'libc/inet/rpc/xdr_array.c')
-rw-r--r-- | libc/inet/rpc/xdr_array.c | 52 |
1 files changed, 25 insertions, 27 deletions
diff --git a/libc/inet/rpc/xdr_array.c b/libc/inet/rpc/xdr_array.c index 7c2831ccd..1e6101719 100644 --- a/libc/inet/rpc/xdr_array.c +++ b/libc/inet/rpc/xdr_array.c @@ -28,7 +28,9 @@ * Mountain View, California 94043 */ #if !defined(lint) && defined(SCCSIDS) -static char sccsid[] = "@(#)xdr_array.c 1.10 87/08/11 Copyr 1984 Sun Micro"; +static char sccsid[] = + + "@(#)xdr_array.c 1.10 87/08/11 Copyr 1984 Sun Micro"; #endif /* @@ -55,23 +57,22 @@ static char sccsid[] = "@(#)xdr_array.c 1.10 87/08/11 Copyr 1984 Sun Micro"; * elsize is the size (in bytes) of each element, and elproc is the * xdr procedure to call to handle each element of the array. */ -bool_t -xdr_array(xdrs, addrp, sizep, maxsize, elsize, elproc) - register XDR *xdrs; - caddr_t *addrp; /* array pointer */ - u_int *sizep; /* number of elements */ - u_int maxsize; /* max numberof elements */ - u_int elsize; /* size in bytes of each element */ - xdrproc_t elproc; /* xdr routine to handle each element */ +bool_t xdr_array(xdrs, addrp, sizep, maxsize, elsize, elproc) +register XDR *xdrs; +caddr_t *addrp; /* array pointer */ +u_int *sizep; /* number of elements */ +u_int maxsize; /* max numberof elements */ +u_int elsize; /* size in bytes of each element */ +xdrproc_t elproc; /* xdr routine to handle each element */ { register u_int i; register caddr_t target = *addrp; - register u_int c; /* the actual element count */ + register u_int c; /* the actual element count */ register bool_t stat = TRUE; register u_int nodesize; /* like strings, arrays are really counted arrays */ - if (! xdr_u_int(xdrs, sizep)) { + if (!xdr_u_int(xdrs, sizep)) { return (FALSE); } c = *sizep; @@ -91,8 +92,7 @@ xdr_array(xdrs, addrp, sizep, maxsize, elsize, elproc) return (TRUE); *addrp = target = mem_alloc(nodesize); if (target == NULL) { - (void) fprintf(stderr, - "xdr_array: out of memory\n"); + (void) fprintf(stderr, "xdr_array: out of memory\n"); return (FALSE); } bzero(target, nodesize); @@ -100,13 +100,13 @@ xdr_array(xdrs, addrp, sizep, maxsize, elsize, elproc) case XDR_FREE: return (TRUE); - } - + } + /* * now we xdr each element of array */ for (i = 0; (i < c) && stat; i++) { - stat = (*elproc)(xdrs, target, LASTUNSIGNED); + stat = (*elproc) (xdrs, target, LASTUNSIGNED); target += elsize; } @@ -130,24 +130,22 @@ xdr_array(xdrs, addrp, sizep, maxsize, elsize, elproc) * > elemsize: size of each element * > xdr_elem: routine to XDR each element */ -bool_t -xdr_vector(xdrs, basep, nelem, elemsize, xdr_elem) - register XDR *xdrs; - register char *basep; - register u_int nelem; - register u_int elemsize; - register xdrproc_t xdr_elem; +bool_t xdr_vector(xdrs, basep, nelem, elemsize, xdr_elem) +register XDR *xdrs; +register char *basep; +register u_int nelem; +register u_int elemsize; +register xdrproc_t xdr_elem; { register u_int i; register char *elptr; elptr = basep; for (i = 0; i < nelem; i++) { - if (! (*xdr_elem)(xdrs, elptr, LASTUNSIGNED)) { - return(FALSE); + if (!(*xdr_elem) (xdrs, elptr, LASTUNSIGNED)) { + return (FALSE); } elptr += elemsize; } - return(TRUE); + return (TRUE); } - |