about summary refs log tree commit diff
path: root/sunrpc/xdr.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1998-10-31 12:13:49 +0000
committerUlrich Drepper <drepper@redhat.com>1998-10-31 12:13:49 +0000
commita1129917d77757941eded59e574f5fc9199284cb (patch)
treef934658661b419f0fe5a2508a15b982a78e4003c /sunrpc/xdr.c
parent655b26bb758d9acb15e4870c1c541bb25c36cdd1 (diff)
downloadglibc-a1129917d77757941eded59e574f5fc9199284cb.tar.gz
glibc-a1129917d77757941eded59e574f5fc9199284cb.tar.xz
glibc-a1129917d77757941eded59e574f5fc9199284cb.zip
Update.
1998-10-30  Thorsten Kukuk  <kukuk@vt.uni-paderborn.de> 
 
	* sunrpc/Versions: Add xdr_uint32_t and xdr_int32_t. 
	* sunrpc/pmap_rmt.c: Initialize clnt_stat variable. 
	* sunrpc/rpc/auth_des.h: Use uint32_t for time values. 
	* sunrpc/rpc/xdr.h: Add INT32 support. 
	* sunrpc/xdr.c: Implement xdr_int32_t and xdr_uint32_t .
 
	* nis/nis_call.c: Changes for new 64bit clean NIS+ interface. 
	* nis/nis_callback.c: Likewise. 
	* nis/nis_creategroup.c: Likewise. 
	* nis/nis_defaults.c: Likewise. 
	* nis/nis_intern.h: Likewise. 
	* nis/nis_lookup.c: Likewise. 
	* nis/nis_ping.c: Likewise. 
	* nis/nis_print.c: Likewise. 
	* nis/nis_table.c: Likewise. 
	* nis/nis_util.c: Likewise. 
	* nis/nis_xdr.c: Likewise. 
	* nis/rpcsvc/nis.h: Likewise. 
	* nis/rpcsvc/nis.x: Likewise. 
	* nis/rpcsvc/nis_callback.h: Likewise. 
	* nis/rpcsvc/nis_object.x: Likewise. 
	* nis/rpcsvc/nislib.h: Likewise. 
 
	* nis/rpcsvc/yp.h: Remove casts to (u_long). 
	* nis/rpcsvc/yp_prot.h: Likewise. 
	* nis/rpcsvc/ypupd.h: Likewise. 
	* nis/ypclnt.c: Change %ld to %d in sprintf. 
 
Diffstat (limited to 'sunrpc/xdr.c')
-rw-r--r--sunrpc/xdr.c62
1 files changed, 45 insertions, 17 deletions
diff --git a/sunrpc/xdr.c b/sunrpc/xdr.c
index 668d9b683b..0e3e5fc63a 100644
--- a/sunrpc/xdr.c
+++ b/sunrpc/xdr.c
@@ -58,17 +58,14 @@ static char sccsid[] = "@(#)xdr.c 1.35 87/08/12";
 /*
  * for unit alignment
  */
-static const char xdr_zero[BYTES_PER_XDR_UNIT] =
-{0, 0, 0, 0};
+static const char xdr_zero[BYTES_PER_XDR_UNIT] = {0, 0, 0, 0};
 
 /*
  * Free a data structure using XDR
  * Not a filter, but a convenient utility nonetheless
  */
 void
-xdr_free (proc, objp)
-     xdrproc_t proc;
-     char *objp;
+xdr_free (xdrproc_t proc, char *objp)
 {
   XDR x;
 
@@ -89,9 +86,7 @@ xdr_void (void)
  * XDR integers
  */
 bool_t
-xdr_int (xdrs, ip)
-     XDR *xdrs;
-     int *ip;
+xdr_int (XDR *xdrs, int *ip)
 {
 
 #if INT_MAX < LONG_MAX
@@ -126,9 +121,7 @@ xdr_int (xdrs, ip)
  * XDR unsigned integers
  */
 bool_t
-xdr_u_int (xdrs, up)
-     XDR *xdrs;
-     u_int *up;
+xdr_u_int (XDR *xdrs, u_int *up)
 {
 #if UINT_MAX < ULONG_MAX
   u_long l;
@@ -159,13 +152,50 @@ xdr_u_int (xdrs, up)
 }
 
 /*
+ * XDR 32bit integers
+ */
+bool_t
+xdr_int32_t (XDR *xdrs, int32_t *lp)
+{
+
+  if (xdrs->x_op == XDR_ENCODE)
+    return XDR_PUTINT32 (xdrs, lp);
+
+  if (xdrs->x_op == XDR_DECODE)
+    return XDR_GETINT32 (xdrs, lp);
+
+  if (xdrs->x_op == XDR_FREE)
+    return TRUE;
+
+  return FALSE;
+}
+
+/*
+ * XDR 32bit unsigned integers
+ */
+bool_t
+xdr_uint32_t (XDR *xdrs, uint32_t *ulp)
+{
+  switch (xdrs->x_op)
+    {
+    case XDR_DECODE:
+      return XDR_GETINT32 (xdrs, (uint32_t *) ulp);
+
+    case XDR_ENCODE:
+      return XDR_PUTINT32 (xdrs, (uint32_t *) ulp);
+
+    case XDR_FREE:
+      return TRUE;
+    }
+  return FALSE;
+}
+
+/*
  * XDR long integers
  * same as xdr_u_long - open coded to save a proc call!
  */
 bool_t
-xdr_long (xdrs, lp)
-     XDR *xdrs;
-     long *lp;
+xdr_long (XDR *xdrs, long *lp)
 {
 
   if (xdrs->x_op == XDR_ENCODE)
@@ -185,9 +215,7 @@ xdr_long (xdrs, lp)
  * same as xdr_long - open coded to save a proc call!
  */
 bool_t
-xdr_u_long (xdrs, ulp)
-     XDR *xdrs;
-     u_long *ulp;
+xdr_u_long (XDR *xdrs, u_long *ulp)
 {
   switch (xdrs->x_op)
     {