Previous | Contents | Index |
Serializes and deserializes the elements of a fixed-length array (known as a vector).
#include <tcpip$rpcxdr.h>bool_t xdr_vector(XDR *xdrs, char **vecpp, u_int elnum, u_int elsize, xdrproc_t elproc);
xdrs
A pointer to an XDR stream handle created by one of the XDR stream-handle creation routines.vecpp
A pointer to a pointer to the array.elnum
The number of elements in the array.elsize
The size, in bytes, of each element.elproc
The XDR routine to handle each element.
A routine that calls elproc to prepare the elements of an array for XDR messages.
TRUE Indicates success. FALSE Indicates failure.
When there is no data to convert, this routine is passed to ONC RPC routines that require an XDR procedure parameter.
#include <tcpip$rpcxdr.h>bool_t xdr_void();
This routine is used as a placeholder for a program that passes no data in a remote procedure call. Most client and server routines expect an XDR routine to be called, even when there is no data to pass.
This routine always returns TRUE.
Serializes and deserializes NULL -terminated strings.
#include <tcpip$rpcxdr.h>bool_t xdr_wrapstring(XDR *xdrs, char **spp);
xdrs
A pointer to an XDR stream handle created by one of the XDR stream-handle creation routines.spp
A pointer to a pointer to a string.
A primitive that calls xdr_string(xdrs, sp, MAXUNSIGNED) , where MAXUNSIGNED is the maximum value of an unsigned integer. This routine is useful because the ONC RPC client and server routines pass the XDR stream handle and a single pointer as parameters to any referenced XDR routines. The xdr_string routine, one of the most frequently used ONC RPC primitives, requires three parameters.While decoding, if *sp is NULL , the necessary storage is allocated to hold the NULL-terminated string and *sp is set to point to it.
TRUE Indicates success. FALSE Indicates failure.
Initializes an XDR stream descriptor for a memory buffer.
#include <tcpip$rpcxdr.h>void xdrmem_create(XDR *xdrs, char *addr, u_int size, enum xdr_op op);
xdrs
A pointer to the XDR stream handle being created. The routine xdrmem_create fills in xdrs with encoding and decoding information.addr
A pointer to the memory buffer.size
The length of the memory buffer.op
An XDR operation, one of: XDR_ENCODE , XDR_DECODE , and XDR_FREE .
The stream handle xdrs is initialized with the operation op , the buffer addr and size , and the operations context for an xdrmem stream.
None
Initializes a record-oriented XDR stream descriptor.
#include <tcpip$rpcxdr.h>void xdrrec_create(XDR *xdrs, u_int sendsize, u_int recvsize, char *tcp_handle, int (*readit)(), int (*writeit)());
xdrs
A pointer to the XDR stream handle being created. The routine xdrrec_create fills in xdrs with encoding and decoding information.sendsize
The send buffer size.recvsize
The receive buffer size.tcp_handle
A pointer to an opaque handle that is passed as the first parameter to the procedures (*readit)() and (*writeit)().(*readit)()
Read procedure that takes the opaque handle tcp_handle . The routine must use the following format:
where tcp_handle is the client or server handle, buffer is the buffer to fill, and len is the number of bytes to read. The readit routine should return either the number of bytes read or the value -1 if an error occurs.
int readit(char *tcp_handle, char *buffer, u_long len)(*writeit)()
Write procedure that takes the opaque handle tcp_handle . The routine must use the following format:
where tcp_handle is the client or server handle, buffer is the buffer to write, and len is the number of bytes to write. The readit routine should return either the number of bytes written or the value -1 if an error occurs.
int writeit(char *tcp_handle, char *buffer, u_long len)
The stream descriptor for xdrs initializes the maximum allowable size for a request recvsize and reply sendsize , the addresses of the routine to perform the read (readit) and write (writeit) , and the TCP handle used for network I/O.
None
Generates an end-of-record for an XDR record.
#include <tcpip$rpcxdr.h>bool_t xdrrec_endofrecord (XDR *xdrs, bool_t sendnow);
xdrs
A pointer to an XDR stream handle created by one of the XDR stream-handle creation routines.sendnow
Indicates whether the record should be sent. If sendnow is TRUE, xdrrec_endofrecord sends the record by calling the writeit routine specified in the call to xdrrec_create . If sendnow is FALSE, xdrrec_endofrecord marks the end of the record and calls writeit when the buffer is full.
This routine lets an application support batch calls and pipelined procedure calls.
TRUE Indicates success. FALSE Indicates failure.
Moves the buffer pointer to the end of the current record and returns an indication if any more data exists in the buffer.
#include <tcpip$rpcxdr.h>bool_t xdrrec_eof (XDR *xdrs);
xdrs
A pointer to an XDR stream handle created by one of the XDR stream-handle creation routines.
Returns TRUE if there is no more input in the buffer after consuming the rest of the current record.
TRUE Indicates no more input in the buffer. FALSE Indicates more input in the buffer.
Guarantees proper record alignment during deserialization from an incoming stream.
#include <tcpip$rpcxdr.h>bool_t xdrrec_skiprecord (XDR *xdrs);
xdrs
A pointer to an XDR stream handle created by one of the XDR stream-handle creation routines.
This routine ensures that the stream is properly aligned in preparation for a subsequent read. It is recommended that, when a record stream is being used, this routine be called prior to any operations that would read from the stream.This routine is similar to the xdrrec_eof routine, except that this routine does not verify whether there is more data in the buffer.
TRUE Indicates success. FALSE Indicates failure.
Initializes an stdio XDR stream.
#include <tcpip$rpcxdr.h>void xdrstdio_create (XDR *xdrs, FILE *file, enum xdr_op op);
xdrs
A pointer to the XDR stream handle being created. The routine xdrstdio_create fills in xdrs with encoding and decoding information..file
A pointer to the FILE structure that is to be associated with the stream.op
An XDR operation, one of: XDR_ENCODE , XDR_DECODE , and XDR_FREE .
Initializes a stdio stream for the specified file.
None
Index | Contents |