\hypertarget{inprocess_8c}{
\section{inprocess.c File Reference}
\label{inprocess_8c}\index{inprocess.c@{inprocess.c}}
}
This demonstrates the basic concepts for writing a client that runs within the JACK server process. 

{\tt \#include $<$stdlib.h$>$}\par
{\tt \#include $<$stdio.h$>$}\par
{\tt \#include $<$memory.h$>$}\par
{\tt \#include $<$jack/jack.h$>$}\par
\subsection*{Data Structures}
\begin{CompactItemize}
\item 
struct \hyperlink{structport__pair__t}{port\_\-pair\_\-t}
\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
int \hyperlink{inprocess_8c_4eaed4d39683eea6a52416b30300b573}{inprocess} (\hyperlink{types_8h_fe9972a13782c1e282747fdb4bc46f9c}{jack\_\-nframes\_\-t} nframes, void $\ast$arg)
\item 
int \hyperlink{inprocess_8c_89b5a6403e3862e0c9e4fa83c5c6c914}{jack\_\-initialize} (\hyperlink{types_8h_44245b219e977ef0a840ee16dbd95b50}{jack\_\-client\_\-t} $\ast$\hyperlink{simple__client_8c_62608e08adc29a8d6dbc9754e659f125}{client}, const char $\ast$load\_\-init)
\item 
void \hyperlink{inprocess_8c_f3db3e200607bd673b8dd39c8a4111a9}{jack\_\-finish} (void $\ast$arg)
\end{CompactItemize}


\subsection{Detailed Description}
This demonstrates the basic concepts for writing a client that runs within the JACK server process. 

For the sake of example, a \hyperlink{structport__pair__t}{port\_\-pair\_\-t} is allocated in \hyperlink{inprocess_8c_89b5a6403e3862e0c9e4fa83c5c6c914}{jack\_\-initialize()}, passed to \hyperlink{inprocess_8c_4eaed4d39683eea6a52416b30300b573}{inprocess()} as an argument, then freed in \hyperlink{inprocess_8c_f3db3e200607bd673b8dd39c8a4111a9}{jack\_\-finish()}. 

\subsection{Function Documentation}
\hypertarget{inprocess_8c_4eaed4d39683eea6a52416b30300b573}{
\index{inprocess.c@{inprocess.c}!inprocess@{inprocess}}
\index{inprocess@{inprocess}!inprocess.c@{inprocess.c}}
\subsubsection[inprocess]{\setlength{\rightskip}{0pt plus 5cm}int inprocess (\hyperlink{types_8h_fe9972a13782c1e282747fdb4bc46f9c}{jack\_\-nframes\_\-t} {\em nframes}, void $\ast$ {\em arg})}}
\label{inprocess_8c_4eaed4d39683eea6a52416b30300b573}


Called in the realtime thread on every process cycle. The entry point name was passed to \hyperlink{jack_8h_bf570688a1c20e1e2339419339df9bbc}{jack\_\-set\_\-process\_\-callback()} from \hyperlink{inprocess_8c_89b5a6403e3862e0c9e4fa83c5c6c914}{jack\_\-initialize()}. Although this is an internal client, its \hyperlink{simple__client_8c_ec08ae186cb5b9cb1ba57ea741d55b23}{process()} interface is identical to \hyperlink{simple__client_8c}{simple\_\-client.c}.

\begin{Desc}
\item[Returns:]0 if successful; otherwise \hyperlink{inprocess_8c_f3db3e200607bd673b8dd39c8a4111a9}{jack\_\-finish()} will be called and the client terminated immediately. \end{Desc}
\hypertarget{inprocess_8c_f3db3e200607bd673b8dd39c8a4111a9}{
\index{inprocess.c@{inprocess.c}!jack_finish@{jack\_\-finish}}
\index{jack_finish@{jack\_\-finish}!inprocess.c@{inprocess.c}}
\subsubsection[jack\_\-finish]{\setlength{\rightskip}{0pt plus 5cm}void jack\_\-finish (void $\ast$ {\em arg})}}
\label{inprocess_8c_f3db3e200607bd673b8dd39c8a4111a9}


This required entry point is called immediately before the client is unloaded, which could happen due to a call to \hyperlink{intclient_8h_c7b3a7b9d3a93bbd0c82a833deeb0ce2}{jack\_\-internal\_\-client\_\-unload()}, or a nonzero return from either \hyperlink{inprocess_8c_89b5a6403e3862e0c9e4fa83c5c6c914}{jack\_\-initialize()} or \hyperlink{inprocess_8c_4eaed4d39683eea6a52416b30300b573}{inprocess()}.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em arg}]the same parameter provided to \hyperlink{inprocess_8c_4eaed4d39683eea6a52416b30300b573}{inprocess()}. \end{description}
\end{Desc}
\hypertarget{inprocess_8c_89b5a6403e3862e0c9e4fa83c5c6c914}{
\index{inprocess.c@{inprocess.c}!jack_initialize@{jack\_\-initialize}}
\index{jack_initialize@{jack\_\-initialize}!inprocess.c@{inprocess.c}}
\subsubsection[jack\_\-initialize]{\setlength{\rightskip}{0pt plus 5cm}int jack\_\-initialize (\hyperlink{types_8h_44245b219e977ef0a840ee16dbd95b50}{jack\_\-client\_\-t} $\ast$ {\em client}, const char $\ast$ {\em load\_\-init})}}
\label{inprocess_8c_89b5a6403e3862e0c9e4fa83c5c6c914}


This required entry point is called after the client is loaded by \hyperlink{intclient_8h_03ffbdaae16521490f39230acbaf65c0}{jack\_\-internal\_\-client\_\-load()}.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em client}]pointer to JACK client structure. \item[{\em load\_\-init}]character string passed to the load operation.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]0 if successful; otherwise \hyperlink{inprocess_8c_f3db3e200607bd673b8dd39c8a4111a9}{jack\_\-finish()} will be called and the client terminated immediately. \end{Desc}
