aboutsummaryrefslogtreecommitdiff
path: root/sunrpc/xdr_mem.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1999-03-08 11:46:22 +0000
committerUlrich Drepper <drepper@redhat.com>1999-03-08 11:46:22 +0000
commit7d1de115db4c8b660d12ad1a72cb95ffa7f7a234 (patch)
treeca94f7d2b4d2e78a93ae8e653cd5ab5528fab2ed /sunrpc/xdr_mem.c
parentb74656f98231fc1d31f8200b3306e2d821ec2cf4 (diff)
downloadglibc-7d1de115db4c8b660d12ad1a72cb95ffa7f7a234.tar
glibc-7d1de115db4c8b660d12ad1a72cb95ffa7f7a234.tar.gz
glibc-7d1de115db4c8b660d12ad1a72cb95ffa7f7a234.tar.bz2
glibc-7d1de115db4c8b660d12ad1a72cb95ffa7f7a234.zip
Update.
1999-03-08 Andreas Schwab <schwab@issan.cs.uni-dortmund.de> * sysdeps/unix/sysv/linux/ttyname.c (ttyname): Undo last change. /dev/pts status may change during runtime. 1999-03-08 Andreas Schwab <schwab@issan.cs.uni-dortmund.de> * sysdeps/unix/sysv/linux/ttyname_r.c (__ttyname_r): Undo last change. /dev/pts status can change during runtime. 1999-03-07 Thorsten Kukuk <kukuk@suse.de> * sunrpc/svc_tcp.c (readtcp): go into fatal error state if poll reports error. * nis/nss_nisplus/nisplus-parser.c: Avoid duplicate strlen calls, add some more sanity checks. * nis/nss_nisplus/nisplus-pwd.c: Include nisplus-parser.h for parser prototype. 1999-03-05 Thorsten Kukuk <kukuk@suse.de> * sunrpc/rpc/xdr.h: Add x_getint32/x_putint32 to xdr_ops, change XDR_GETINT32/XDR_PUTINT32 to sue new functions. * sunrpc/xdr_mem.c: Add xdrmem_getint32, xdrmem_putint32. * sunrpc/xdr_rec.c: Add xdrrec_getint32, xdrrec_putint32. * sunrpc/xdr_sizeof.c: Add x_putint32, add dummy function for x_getint32. * sunrpc/xdr_stdio.c: Add xdrstdio_getint32, xdrstdio_putint32. * nis/nis_print.c: Fix ctime argument for platforms where sizeof (time_t) != sizeof (int). 255. Patch by Bruno Haible <haible@ilog.fr> [PR libc/1010].
Diffstat (limited to 'sunrpc/xdr_mem.c')
-rw-r--r--sunrpc/xdr_mem.c38
1 files changed, 37 insertions, 1 deletions
diff --git a/sunrpc/xdr_mem.c b/sunrpc/xdr_mem.c
index 47b87eaf7a..9379048bf7 100644
--- a/sunrpc/xdr_mem.c
+++ b/sunrpc/xdr_mem.c
@@ -54,6 +54,8 @@ static u_int xdrmem_getpos (const XDR *);
static bool_t xdrmem_setpos (XDR *, u_int);
static long *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 *);
static const struct xdr_ops xdrmem_ops =
{
@@ -64,7 +66,9 @@ static const struct xdr_ops xdrmem_ops =
xdrmem_getpos,
xdrmem_setpos,
xdrmem_inline,
- xdrmem_destroy
+ xdrmem_destroy,
+ xdrmem_getint32,
+ xdrmem_putint32
};
/*
@@ -219,3 +223,35 @@ xdrmem_inline (xdrs, len)
}
return buf;
}
+
+/*
+ * Gets the next word from the memory referenced by xdrs and places it
+ * in the int pointed to by ip. It then increments the private word to
+ * point at the next element. Neither object pointed to is const
+ */
+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))));
+ xdrs->x_private += 4;
+ return TRUE;
+}
+
+/*
+ * Puts the long pointed to by lp in the memory referenced by xdrs. It
+ * then increments the private word to point at the next element. The
+ * long pointed at is const
+ */
+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);
+ xdrs->x_private += 4;
+ return TRUE;
+}