XDR_SIMPLE(3N) — NETWORK FUNCTIONS
NAME
xdr_bool, xdr_char, xdr_double, xdr_enum, xdr_float, xdr_free, xdr_int, xdr_long, xdr_short, xdr_u_char, xdr_u_int, xdr_u_long, xdr_u_short, xdr_void − library routines for translating simple data types
DESCRIPTION
XDR library routines allow C programmers to describe simple data structures in a machine-independent fashion. Protocols such as remote procedure calls (RPC) use these routines to describe the format of the data.
These routines require the creation of XDR streams (see xdr_create(3N)).
Routines
The XDR data structure is defined in the RPC/XDR Library Definitions of the Network Programming.
#include <rpc/xdr.h>
bool_t xdr_bool(xdrs, bp)
XDR ∗xdrs;
bool_t ∗bp;
A filter primitive that translates between a boolean (C integer) and its external representation. When encoding data, this filter produces values of either one or zero. This routine returns TRUE if it succeeds, FALSE otherwise.
bool_t xdr_char(xdrs, cp)
XDR ∗xdrs;
char ∗cp;
A filter primitive that translates between a C character and its external representation. This routine returns TRUE if it succeeds, FALSE otherwise.
Note: Encoded characters are not packed, and occupy 4 bytes each. For arrays of characters, it is worthwhile to consider xdr_bytes(), xdr_opaque() or xdr_string() , see xdr_complex(3N).
bool_t xdr_double(xdrs, dp)
XDR ∗xdrs;
double ∗dp;
A filter primitive that translates between a C double precision number and its external representation. This routine returns TRUE if it succeeds, FALSE otherwise.
bool_t xdr_enum(xdrs, ep)
XDR ∗xdrs;
enum_t ∗ep;
A filter primitive that translates between a C enum (actually integer) and its external representation. This routine returns TRUE if it succeeds, FALSE otherwise.
bool_t xdr_float(xdrs, fp)
XDR ∗xdrs;
float ∗fp;
A filter primitive that translates between a C float and its external representation. This routine returns TRUE if it succeeds, FALSE otherwise.
void xdr_free(proc, objp)
xdrproc_t proc;
char ∗objp;
Generic freeing routine. The first argument is the XDR routine for the object being freed. The second argument is a pointer to the object itself. Note: The pointer passed to this routine is not freed, but what it points to is freed, recursively such that objects pointed to are also freed for example, linked lists.
bool_t xdr_int(xdrs, ip)
XDR ∗xdrs;
int ∗ip;
A filter primitive that translates between a C integer and its external representation. This routine returns TRUE if it succeeds, FALSE otherwise.
bool_t xdr_long(xdrs, lp)
XDR ∗xdrs;
long ∗lp;
A filter primitive that translates between a C long integer and its external representation. This routine returns TRUE if it succeeds, FALSE otherwise.
bool_t xdr_short(xdrs, sp)
XDR ∗xdrs;
short ∗sp;
A filter primitive that translates between a C short integer and its external representation. This routine returns TRUE if it succeeds, FALSE otherwise.
bool_t xdr_u_char(xdrs, ucp)
XDR ∗xdrs;
unsigned char ∗ucp;
A filter primitive that translates between an unsigned C character and its external representation. This routine returns TRUE if it succeeds, FALSE otherwise.
bool_t xdr_u_int(xdrs, up)
XDR ∗xdrs;
unsigned ∗up;
A filter primitive that translates between a C unsigned integer and its external representation. This routine returns TRUE if it succeeds, FALSE otherwise.
bool_t xdr_u_long(xdrs, ulp)
XDR ∗xdrs;
unsigned long ∗ulp;
A filter primitive that translates between a C unsigned long integer and its external representation. This routine returns TRUE if it succeeds, FALSE otherwise.
bool_t xdr_u_short(xdrs, usp)
XDR ∗xdrs;
unsigned short ∗usp;
A filter primitive that translates between a C unsigned short integer and its external representation. This routine returns TRUE if it succeeds, FALSE otherwise.
bool_t xdr_void()
This routine always returns TRUE. It may be passed to RPC routines that require a function parameter, where nothing is to be done.
SEE ALSO
xdr(3N), xdr_admin(3N), xdr_complex(3N), xdr_create(3N)
Sun Release 4.1 — Last change: 20 January 1990