Cookie

The cookie is a lightweight mechanism for controlling and detecting the behaviour of a given interpretation call (i.e. fz_run_page, fz_run_page_contents, fz_run_annot, fz_run_display_list etc).

To use the cookie, a caller should simply define:


\begin{lstlisting}
fz_cookie *cookie = { 0 };
\end{lstlisting}

set any required fields, for example:


\begin{lstlisting}
cookie.incomplete_ok = 1;
\end{lstlisting}

and then pass &cookie as the last parameter to the interpretation call, for example:


\begin{lstlisting}
fz_run_page(ctx, page, dev, transform, &cookie);
\end{lstlisting}

The contents and definition of fz_cookie are even more subject to change than other structures, so it is important to always initialise all the subfields to zero. The safest way to do this is as given above. If new fields are added to the structure, callers code should not need to change, and the default behaviour of zero-valued new fields will always remain the same.



Subsections