summaryrefslogtreecommitdiff
path: root/doc/tex/callbacks.tex
blob: edd718a8023cdd5de276b43354fff9d7e0d070a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
\section{Callback functions}
\index{Callback functions}

There are several cases where \gnutls{} may need some out of band input from
your program. This is now implemented using some callback functions,
which your program is expected to register.

An example of this type of functions are the push and pull callbacks
which are used to specify the functions that will retrieve and send
data to the transport layer.
\begin{itemize}
\item \printfunc{gnutls_transport_set_push_function}{gnutls\_transport\_set\_push\_function}
\item \printfunc{gnutls_transport_set_pull_function}{gnutls\_transport\_set\_pull\_function}
\end{itemize}

Other callback functions such as the one set by
\printfunc{gnutls_srp_set_server_credentials_function}{gnutls\_srp\_set\_server\_credentials\_function},
may require more complicated input, including data to be allocated.
These callbacks should allocate and free memory using the functions shown below.
\begin{itemize}
\item \printfunc{gnutls_malloc}{gnutls\_malloc}
\item \printfunc{gnutls_free}{gnutls\_free}
\end{itemize}