mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-29 11:41:21 +03:00
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.
This commit is contained in:
62
sunrpc/xdr.c
62
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;
|
||||
@ -158,14 +151,51 @@ xdr_u_int (xdrs, up)
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* 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)
|
||||
{
|
||||
|
Reference in New Issue
Block a user