The pblock_pblock2str function copies all parameters of a specified pblock into a specified string. The function allocates additional nonheap space for the string if needed.
Use this function to stream the pblock for archival and other purposes.
char *pblock_pblock2str(pblock *pb, char *str);
The new version of the str parameter. If str is NULL, the string is a new string otherwise, the string is a reallocated string. In either case, it is allocated from the request’s memory pool.
pblock *pb is the pblock to be copied.
char *str is the string into which the pblock is to be copied. The string must have been allocated by MALLOC or REALLOC, not by PERM_MALLOC or PERM_REALLOC, which allocate from the system heap.
Each name-value pair in the string is separated from its neighbor pair by a space, and is in the format name="value."