diff options
author | Eric Andersen <andersen@codepoet.org> | 2000-10-09 20:06:30 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2000-10-09 20:06:30 +0000 |
commit | c1fe19d4c1db610692365472a90f4661e48449c1 (patch) | |
tree | d0b0219ffca3c4c4256f55c4aea4513e43d6aecd /libc/inet/rpc/xdr_mem.c | |
parent | 9efafb8bbc7408b04643dcd53825d971577b4d9d (diff) |
Bug ugly formatting update
Diffstat (limited to 'libc/inet/rpc/xdr_mem.c')
-rw-r--r-- | libc/inet/rpc/xdr_mem.c | 101 |
1 files changed, 48 insertions, 53 deletions
diff --git a/libc/inet/rpc/xdr_mem.c b/libc/inet/rpc/xdr_mem.c index 558d36922..b05f2b6f3 100644 --- a/libc/inet/rpc/xdr_mem.c +++ b/libc/inet/rpc/xdr_mem.c @@ -47,16 +47,16 @@ static char sccsid[] = "@(#)xdr_mem.c 1.19 87/08/11 Copyr 1984 Sun Micro"; #include <rpc/xdr.h> #include <netinet/in.h> -static bool_t xdrmem_getlong(); -static bool_t xdrmem_putlong(); -static bool_t xdrmem_getbytes(); -static bool_t xdrmem_putbytes(); -static u_int xdrmem_getpos(); -static bool_t xdrmem_setpos(); -static long * xdrmem_inline(); -static void xdrmem_destroy(); - -static struct xdr_ops xdrmem_ops = { +static bool_t xdrmem_getlong(); +static bool_t xdrmem_putlong(); +static bool_t xdrmem_getbytes(); +static bool_t xdrmem_putbytes(); +static u_int xdrmem_getpos(); +static bool_t xdrmem_setpos(); +static long *xdrmem_inline(); +static void xdrmem_destroy(); + +static struct xdr_ops xdrmem_ops = { xdrmem_getlong, xdrmem_putlong, xdrmem_getbytes, @@ -71,12 +71,11 @@ static struct xdr_ops xdrmem_ops = { * The procedure xdrmem_create initializes a stream descriptor for a * memory buffer. */ -void -xdrmem_create(xdrs, addr, size, op) - register XDR *xdrs; - caddr_t addr; - u_int size; - enum xdr_op op; +void xdrmem_create(xdrs, addr, size, op) +register XDR *xdrs; +caddr_t addr; +u_int size; +enum xdr_op op; { xdrs->x_op = op; @@ -85,43 +84,43 @@ xdrmem_create(xdrs, addr, size, op) xdrs->x_handy = size; } -static void -xdrmem_destroy(/*xdrs*/) - /*XDR *xdrs;*/ +static void xdrmem_destroy( /*xdrs */ ) + /*XDR *xdrs; */ { } -static bool_t -xdrmem_getlong(xdrs, lp) - register XDR *xdrs; - long *lp; +static bool_t xdrmem_getlong(xdrs, lp) +register XDR *xdrs; +long *lp; { if ((xdrs->x_handy -= sizeof(long)) < 0) return (FALSE); - *lp = (long)ntohl((u_long)(*((long *)(xdrs->x_private)))); + + *lp = (long) ntohl((u_long) (*((long *) (xdrs->x_private)))); xdrs->x_private += sizeof(long); + return (TRUE); } -static bool_t -xdrmem_putlong(xdrs, lp) - register XDR *xdrs; - long *lp; +static bool_t xdrmem_putlong(xdrs, lp) +register XDR *xdrs; +long *lp; { if ((xdrs->x_handy -= sizeof(long)) < 0) return (FALSE); - *(long *)xdrs->x_private = (long)htonl((u_long)(*lp)); + + *(long *) xdrs->x_private = (long) htonl((u_long) (*lp)); xdrs->x_private += sizeof(long); + return (TRUE); } -static bool_t -xdrmem_getbytes(xdrs, addr, len) - register XDR *xdrs; - caddr_t addr; - register u_int len; +static bool_t xdrmem_getbytes(xdrs, addr, len) +register XDR *xdrs; +caddr_t addr; +register u_int len; { if ((xdrs->x_handy -= len) < 0) @@ -131,11 +130,10 @@ xdrmem_getbytes(xdrs, addr, len) return (TRUE); } -static bool_t -xdrmem_putbytes(xdrs, addr, len) - register XDR *xdrs; - caddr_t addr; - register u_int len; +static bool_t xdrmem_putbytes(xdrs, addr, len) +register XDR *xdrs; +caddr_t addr; +register u_int len; { if ((xdrs->x_handy -= len) < 0) @@ -145,33 +143,30 @@ xdrmem_putbytes(xdrs, addr, len) return (TRUE); } -static u_int -xdrmem_getpos(xdrs) - register XDR *xdrs; +static u_int xdrmem_getpos(xdrs) +register XDR *xdrs; { - return ((u_int)xdrs->x_private - (u_int)xdrs->x_base); + return ((u_int) xdrs->x_private - (u_int) xdrs->x_base); } -static bool_t -xdrmem_setpos(xdrs, pos) - register XDR *xdrs; - u_int pos; +static bool_t xdrmem_setpos(xdrs, pos) +register XDR *xdrs; +u_int pos; { register caddr_t newaddr = xdrs->x_base + pos; register caddr_t lastaddr = xdrs->x_private + xdrs->x_handy; - if ((long)newaddr > (long)lastaddr) + if ((long) newaddr > (long) lastaddr) return (FALSE); xdrs->x_private = newaddr; - xdrs->x_handy = (int)lastaddr - (int)newaddr; + xdrs->x_handy = (int) lastaddr - (int) newaddr; return (TRUE); } -static long * -xdrmem_inline(xdrs, len) - register XDR *xdrs; - int len; +static long *xdrmem_inline(xdrs, len) +register XDR *xdrs; +int len; { long *buf = 0; |