xdrrec_create(3) CLIX xdrrec_create(3)
NAME
xdrrec_create, xdrrec_eof, xdrrec_endofrecord, xdrrec_skiprecord - Library
functions for external data representation
LIBRARY
Berkeley Software Distribution Library (libbsd.a)
SYNOPSIS
#include <sys/xdr.h>
void xdrrec_create(
XDR *xdrs ,
uint sendsize ,
uint recvsize ,
char *handle ,
int (*readit)() ,
int (*writeit)() );
xdrrec_eof(
XDR *xdrs );
xdrrec_endofrecord(
XDR *xdrs ,
int sendnow );
xdrrec_skiprecord(
XDR *xdrs );
PARAMETERS
xdrs Specifies the address of the XDR handle.
sendsize Specifies the size of the output buffer.
recvsize Specifies the size of the input buffer.
handle Specifies the address of the first parameter passed to the
readit() and writeit() functions.
readit Specifies the address of the function to call when the stream's
input buffer is empty.
writeit Specifies the address of the function to call when the stream's
output buffer is full.
sendnow Specifies whether the completed record should be immediately
sent.
2/94 - Intergraph Corporation 1
xdrrec_create(3) CLIX xdrrec_create(3)
DESCRIPTION
The xdrrec_create(), xdrrec_eof(), xdrrec_endofrecord(), and
xdrrec_skiprecord() functions allow C programmers to describe arbitrary
data structures in a machine-independent fashion. Data for remote
procedure calls are transmitted using these functions.
The xdrrec_create() function initializes the XDR stream object pointed to
by xdrs. The stream's data is written to a buffer of size sendsize. A
value of 0 indicates the system should use a suitable default. The
stream's data is read from a buffer of size recvsize; it too can be set to
a suitable default by passing a 0 value. When a stream's output buffer is
full, writeit() is called. Similarly, when a stream's input buffer is
empty, readit() is called. The behavior of these two functions is similar
to the UNIX functions read() and write(), except that handle is passed to
the former functions as the first parameter. Note that the XDR stream's
op field must be set by the caller. This XDR stream implements an
intermediate record stream. Therefore, there are additional bytes in the
stream to provide record boundary information.
The xdrrec_eof() function can be invoked only on streams created by
xdrrec_create(). After consuming the rest of the current record in the
stream, this function returns 1 if the stream has no more input.
Otherwise, it returns 0.
The xdrrec_endofrecord() function can be invoked only on streams created
by xdrrec_create(). The data in the output buffer is marked as a
completed record, and the output buffer is optionally written out if
sendnow is nonzero.
The xdrrec_skiprecord() function can be invoked only on streams created by
xdrrec_create(). It tells the XDR implementation that the rest of the
current record in the stream's input buffer should be discarded.
RETURN VALUES
After consuming the rest of the current record in the stream, the
xdrrec_eof() function returns 1 if the stream has no more input.
Otherwise, it returns 0.
The xdrrec_create() function returns void.
The xdrrec_endofrecord() and xdrrec_skiprecord() functions return 1 if
successful, and 0 otherwise.
RELATED INFORMATION
Functions: xdr_bytes(3), xdr_getpos(3), xdr_pointer(3), xdrrec_create(3),
xdr_array(3), xdr_destroy(3), xdr_free(3), xdr_inline(3),
xdrmem_create(3), xdr_opaque(3), xdr_union(3), xdr_vector(3), xdr_void(3),
authunix_create(3), clnt_pcreateerror(3), clnt_perrno(3), clnt_perror(3),
2 Intergraph Corporation - 2/94
xdrrec_create(3) CLIX xdrrec_create(3)
clntraw_create(3), clnttcp_create(3), pmap_set(3), svc_getargs(3),
svc_getreqset(3), svc_register(3), svcerr_auth(3), svctcp_create(3),
xprt_register(3), clnt_broadcast(3), clnt_call(3), clnt_create(3),
clnt_control(3), clnt_destroy(3), clnt_freeres(3), clnt_geterr(3),
clnt_getmyaddr(3), registerrpc(3), svc_destroy(3), svc_getcaller(3),
svc_run(3), svc_sendreply(3), xdr_accepted_reply(3),
xdr_authunix_parms(3), xdr_callhdr(3), xdr_callmsg(3), xdr_opaque_auth(3),
xdr_pmap(3), xdr_pmaplist(3), xdr_rejected_reply(3), xdr_replymsg(3)
CLIX Programming Guide
XDR: External Data Representation Standard, RFC1014, Sun Microsystems,
Inc., USC-ISI
2/94 - Intergraph Corporation 3