Reading objects

Often, when parsing different document formats, it can be useful to read specific objects from streams, so convenience functions exist for this too. Firstly, integers of different size and endianness are catered for:


\begin{lstlisting}
/*
fz_read_[u]int(16\vert 24\vert 32\vert 64)(_le)?
\par
Rea...
...tm);
int64_t fz_read_int64_le(fz_context *ctx, fz_stream *stm);
\end{lstlisting}

We have functions to read both C style strings, and newline/return terminated lines:


\begin{lstlisting}
/*
fz_read_string: Read a null terminated string from the st...
...d_line(fz_context *ctx, fz_stream *stm, char *buf, size_t max);
\end{lstlisting}