aboutsummaryrefslogtreecommitdiff
path: root/sunrpc/xdr_mem.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1999-04-15 13:54:57 +0000
committerUlrich Drepper <drepper@redhat.com>1999-04-15 13:54:57 +0000
commitf8afba91cf8bf8f8324c3c88b8c368e7c2bd5894 (patch)
treedbdd5f960cf217c76d495ba44173feafae9d184f /sunrpc/xdr_mem.c
parenta5486962345290853d7d42ef4a799f16bd6764e2 (diff)
downloadglibc-f8afba91cf8bf8f8324c3c88b8c368e7c2bd5894.zip
glibc-f8afba91cf8bf8f8324c3c88b8c368e7c2bd5894.tar.gz
glibc-f8afba91cf8bf8f8324c3c88b8c368e7c2bd5894.tar.bz2
Update.
* Versions.def: Add GLIBC_2.1.1 to libpthread. * iconvdata/Makefile (modules): Add KOI8-U. (distribute): Add koi8-u.c. (gen-8bit-gap-modules): Add koi8-u. * iconvdata/gconv-modules: Add KOI8-U entries. * iconvdata/koi8-u.c: New file. 1999-04-13 Thorsten Kukuk <kukuk@suse.de> * sunrpc/auth_des.c: 64bit fixes, security fixes. * sunrpc/auth_none.c: Pretty print. * sunrpc/auth_unix.c: Likewise. * sunrpc/authdes_prot.c: Likewise. * sunrpc/authuxprot.c: Likewise. * sunrpc/bindrsvprt.c: Likewise. * sunrpc/clnt_gen.c: Likewise. * sunrpc/rpc/xdr.h: Likewise. * sunrpc/rpc/auth_des.h: Add rpc_timeval struct. * sunrpc/rpc_cmsg.c: Don't use *long pointers. * sunrpc/rtime.c: Use new rpc_timeval. * sunrpc/svc_authux.c: Don't use *long pointers. * sunrpc/svcauth_des.c: Likewise + security fixes. * sunrpc/xdr_mem.c: Don't use *long pointers. * sunrpc/xdr_rec.c: Likewise. * sunrpc/xdr_sizeof.c: Likewise. * sunrpc/xdr_stdio.c: Likewise. 1999-04-15 Ulrich Drepper <drepper@cygnus.com>
Diffstat (limited to 'sunrpc/xdr_mem.c')
-rw-r--r--sunrpc/xdr_mem.c52
1 files changed, 11 insertions, 41 deletions
diff --git a/sunrpc/xdr_mem.c b/sunrpc/xdr_mem.c
index 9379048..9cc3890 100644
--- a/sunrpc/xdr_mem.c
+++ b/sunrpc/xdr_mem.c
@@ -1,4 +1,3 @@
-/* @(#)xdr_mem.c 2.1 88/07/29 4.0 RPCSRC */
/*
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
* unrestricted use provided that this legend is included on all tape
@@ -27,9 +26,6 @@
* 2550 Garcia Avenue
* Mountain View, California 94043
*/
-#if !defined(lint) && defined(SCCSIDS)
-static char sccsid[] = "@(#)xdr_mem.c 1.19 87/08/11 Copyr 1984 Sun Micro";
-#endif
/*
* xdr_mem.h, XDR implementation using memory buffers.
@@ -42,7 +38,6 @@ static char sccsid[] = "@(#)xdr_mem.c 1.19 87/08/11 Copyr 1984 Sun Micro";
*
*/
-
#include <string.h>
#include <rpc/rpc.h>
@@ -52,7 +47,7 @@ static bool_t xdrmem_getbytes (XDR *, caddr_t, u_int);
static bool_t xdrmem_putbytes (XDR *, const char *, u_int);
static u_int xdrmem_getpos (const XDR *);
static bool_t xdrmem_setpos (XDR *, u_int);
-static long *xdrmem_inline (XDR *, int);
+static int32_t *xdrmem_inline (XDR *, int);
static void xdrmem_destroy (XDR *);
static bool_t xdrmem_getint32 (XDR *, int32_t *);
static bool_t xdrmem_putint32 (XDR *, const int32_t *);
@@ -76,13 +71,8 @@ static const struct xdr_ops xdrmem_ops =
* memory buffer.
*/
void
-xdrmem_create (xdrs, addr, size, op)
- XDR *xdrs;
- const caddr_t addr;
- u_int size;
- enum xdr_op op;
+xdrmem_create (XDR *xdrs, const caddr_t addr, u_int size, enum xdr_op op)
{
-
xdrs->x_op = op;
/* We have to add the const since the `struct xdr_ops' in `struct XDR'
is not `const'. */
@@ -107,11 +97,8 @@ xdrmem_destroy (XDR *xdrs)
* point at the next element. Neither object pointed to is const
*/
static bool_t
-xdrmem_getlong (xdrs, lp)
- XDR *xdrs;
- long *lp;
+xdrmem_getlong (XDR *xdrs, long *lp)
{
-
if ((xdrs->x_handy -= 4) < 0)
return FALSE;
*lp = (int32_t) ntohl ((*((int32_t *) (xdrs->x_private))));
@@ -125,11 +112,8 @@ xdrmem_getlong (xdrs, lp)
* long pointed at is const
*/
static bool_t
-xdrmem_putlong (xdrs, lp)
- XDR *xdrs;
- const long *lp;
+xdrmem_putlong (XDR *xdrs, const long *lp)
{
-
if ((xdrs->x_handy -= 4) < 0)
return FALSE;
*(int32_t *) xdrs->x_private = htonl (*lp);
@@ -144,12 +128,8 @@ xdrmem_putlong (xdrs, lp)
* a good idea. None of the things pointed to are const.
*/
static bool_t
-xdrmem_getbytes (xdrs, addr, len)
- XDR *xdrs;
- caddr_t addr;
- u_int len;
+xdrmem_getbytes (XDR *xdrs, caddr_t addr, u_int len)
{
-
if ((xdrs->x_handy -= len) < 0)
return FALSE;
bcopy (xdrs->x_private, addr, len);
@@ -162,12 +142,8 @@ xdrmem_getbytes (xdrs, addr, len)
* unaligned data. The source address is const.
*/
static bool_t
-xdrmem_putbytes (xdrs, addr, len)
- XDR *xdrs;
- const char *addr;
- u_int len;
+xdrmem_putbytes (XDR *xdrs, const char *addr, u_int len)
{
-
if ((xdrs->x_handy -= len) < 0)
return FALSE;
bcopy (addr, xdrs->x_private, len);
@@ -180,10 +156,8 @@ xdrmem_putbytes (xdrs, addr, len)
* of xdrs. **FIXME** does this not assume u_int == u_long?
*/
static u_int
-xdrmem_getpos (xdrs)
- const XDR *xdrs;
+xdrmem_getpos (const XDR *xdrs)
{
-
return (u_long) xdrs->x_private - (u_long) xdrs->x_base;
}
@@ -208,17 +182,15 @@ xdrmem_setpos (xdrs, pos)
/*
* xdrs modified
*/
-static long *
-xdrmem_inline (xdrs, len)
- XDR *xdrs;
- int len;
+static int32_t *
+xdrmem_inline (XDR *xdrs, int len)
{
- long *buf = 0;
+ int32_t *buf = 0;
if (xdrs->x_handy >= len)
{
xdrs->x_handy -= len;
- buf = (long *) xdrs->x_private;
+ buf = (int32_t *) xdrs->x_private;
xdrs->x_private += len;
}
return buf;
@@ -232,7 +204,6 @@ xdrmem_inline (xdrs, len)
static bool_t
xdrmem_getint32 (XDR *xdrs, int32_t *ip)
{
-
if ((xdrs->x_handy -= 4) < 0)
return FALSE;
*ip = ntohl ((*((int32_t *) (xdrs->x_private))));
@@ -248,7 +219,6 @@ xdrmem_getint32 (XDR *xdrs, int32_t *ip)
static bool_t
xdrmem_putint32 (XDR *xdrs, const int32_t *ip)
{
-
if ((xdrs->x_handy -= 4) < 0)
return FALSE;
*(int32_t *) xdrs->x_private = htonl (*ip);