int flux_msg_encode (const flux_msg_t *msg, void **buf, size_t *size);
flux_msg_t *flux_msg_decode (void *buf, size_t size);
flux_msg_encode() converts msg to a serialized representation,
allocated internally and assigned to buf, number of bytes to size.
The caller must release buf with free(3).
flux_msg_decode() performs the inverse, creating msg from buf and size.
The caller must destroy msg with flux_msg_destroy().
flux_msg_encode() returns 0 on success. On error, -1 is returned,
and errno is set appropriately.
flux_msg_decode() the decoded message on success. On error, NULL
is returned, and errno is set appropriately.
- Some arguments were invalid.
- Out of memory.