/* 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, mxml_save_cb_t cb)
/* 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, mxml_save_cb_t cb)
{
  int		col;
  _mxml_fdbuf_t	buf;
  _mxml_global_t *global = _mxml_global();
  buf.fd      = fd;
  buf.current = buf.buffer;
  buf.end     = buf.buffer + sizeof(buf.buffer);
  if ((col = mxml_write_node(node, &buf, cb, 0, mxml_fd_putc, global)) < 0)
    return (-1);
  if (col > 0)
    if (mxml_fd_putc('\n', &buf) < 0)
      return (-1);
  return (mxml_fd_write(&buf));
}