Creation

The exact function to call to create an output stream depends on the specific stream required, but they generally follow a similar format. Some common examples are:


\begin{lstlisting}
/*
fz_new_output_with_file: Open an output stream that write...
...ut *fz_new_output_with_buffer(fz_context *ctx, fz_buffer *buf);
\end{lstlisting}

One of the most common use cases is to get an output stream that goes to stdout or stderr, and we provide convenience functions for exactly this. In addition we allow the streams for stdout and stderr to be replaced by other fz_outputs, thus allowing redirection to be changed simply for any of our existing tools:


\begin{lstlisting}
/*
fz_stdout: The standard out output stream. By default
th...
...to use.
*/
void fz_set_stderr(fz_context *ctx, fz_output *err);
\end{lstlisting}