summaryrefslogtreecommitdiff
path: root/libc/inet/rpc/xdr_array.c
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2000-10-09 20:06:30 +0000
committerEric Andersen <andersen@codepoet.org>2000-10-09 20:06:30 +0000
commitc1fe19d4c1db610692365472a90f4661e48449c1 (patch)
treed0b0219ffca3c4c4256f55c4aea4513e43d6aecd /libc/inet/rpc/xdr_array.c
parent9efafb8bbc7408b04643dcd53825d971577b4d9d (diff)
Bug ugly formatting update
Diffstat (limited to 'libc/inet/rpc/xdr_array.c')
-rw-r--r--libc/inet/rpc/xdr_array.c52
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);
}
-