ONC+ Developer's Guide

Number Filters

The XDR library provides primitives to translate between numbers and their corresponding external representations. Primitives cover the set of numbers in the types:

[signed, unsigned] * [short, int, long]

Specifically, the eight primitives are:

bool_t xdr_char(xdrs, op)
   XDR *xdrs;
   char *cp;
bool_t xdr_u_char(xdrs, ucp)
  	XDR *xdrs;
  	unsigned char *ucp;
bool_t xdr_int(xdrs, ip)
  	XDR *xdrs;
  	int *ip;
bool_t xdr_u_int(xdrs, up)
  	XDR *xdrs;
  	unsigned *up;
bool_t xdr_long(xdrs, lip)
  	XDR *xdrs;
  	long *lip;
bool_t xdr_u_long(xdrs, lup)
  	XDR *xdrs;
  	u_long *lup;
bool_t xdr_short(xdrs, sip)
  	XDR *xdrs;
  	short *sip;
bool_t xdr_u_short(xdrs, sup)
  	XDR *xdrs;
  	u_short *sup;

The first parameter, xdrs, is an XDR stream handle. The second parameter is the address of the number that provides data to the stream or receives data from it. All routines return TRUE if they complete successfully, and FALSE otherwise.