Serializes and deserializes strings (arrays of bytes terminated by a NULL character). Format #include <tcpip$rpcxdr.h> bool_t xdr_string(XDR *xdrs, char **spp, u_int maxsize);
1 – Arguments
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 character string. maxsize The maximum size of the string.
2 – Description
A filter primitive that translates between strings and their corresponding external representations. Strings cannot be longer than the value specified with the maxsize parameter. While decoding, if *spp is NULL, this routine allocates the necessary storage to hold the NULL-terminated string and sets *spp to point to the allocated storage. This routine is the same as the xdr_wrapstring routine, except that this routine allows you to specify maxsize.
3 – Return Values
TRUE Indicates success. FALSE Indicates failure.