Save an XML tree to a file descriptor. The callback argument specifies a function that returns a whitespace string or NULL before and after each element. If MXML_NO_CALLBACK is specified, whitespace will only be added before MXML_TEXT nodes with leading whitespace and before attribute names inside opening element tags.
int mxmlSaveFd( mxml_node_t * node, int fd, const char * (*cb)(mxml_node_t *node, int ws));
Name | Description |
---|---|
node | Node to write |
fd | File descriptor to write to |
(*cb)(mxml_node_t *node, int ws) | Whitespace callback or MXML_NO_CALLBACK |
0 on success, -1 on error.