# Document Save Functions

## Functions
int | tidySaveFile (TidyDoc tdoc, ctmbstr filename)
int | tidySaveStdout (TidyDoc tdoc)
int | tidySaveBuffer (TidyDoc tdoc, TidyBuffer *buf)
int | tidySaveString (TidyDoc tdoc, tmbstr buffer, uint *buflen)
int | tidySaveSink (TidyDoc tdoc, TidyOutputSink *sink)

## Detailed Description

Save currently parsed document to the given output sink. File name and string/buffer functions provided for convenience.

## Function Documentation

int tidySaveFile | ( | TidyDoc | tdoc,
|  | ctmbstr | filename
| ) |

| Save to named file

int tidySaveStdout | ( | TidyDoc | tdoc | ) |

| Save to standard output (FILE*)

int tidySaveBuffer | ( | TidyDoc | tdoc,
|  | TidyBuffer * | buf
| ) |

| Save to given TidyBuffer object

int tidySaveString | ( | TidyDoc | tdoc,
|  | tmbstr | buffer,
|  | uint * | buflen
| ) |

| Save document to application buffer. If buffer is not big enough, ENOMEM will be returned and the necessary buffer size will be placed in *buflen.

int tidySaveSink | ( | TidyDoc | tdoc,
|  | TidyOutputSink * | sink
| ) |

| Save to given generic output sink