\hypertarget{FORK_8c}{
\section{FORK.c File Reference}
\label{FORK_8c}\index{FORK.c@{FORK.c}}
}
The FORK routines. 


{\tt \#include \char`\"{}BBC/LLI.ih\char`\"{}}\par
{\tt \#include \char`\"{}BBC/TASK.h\char`\"{}}\par
{\tt \#include \char`\"{}BBC/FORK.h\char`\"{}}\par
\subsection*{Data Structures}
\begin{CompactItemize}
\item 
struct \hyperlink{struct__FORK__fcb}{\_\-FORK\_\-fcb}
\begin{CompactList}\small\item\em The Fork Control Block.\item\end{CompactList}\end{CompactItemize}
\subsection*{Typedefs}
\begin{CompactItemize}
\item 
\hypertarget{FORK_8c_a0}{
\index{FORK_msg_type@{FORK\_\-msg\_\-type}!FORK.c@{FORK.c}}\index{FORK.c@{FORK.c}!FORK_msg_type@{FORK\_\-msg\_\-type}}
typedef enum \hyperlink{FORK_8c_a11}{\_\-FORK\_\-msg\_\-type} \hyperlink{FORK_8c_a0}{FORK\_\-msg\_\-type}}
\label{FORK_8c_a0}

\begin{CompactList}\small\item\em Typedef for enum FORK\_\-msg\_\-type.\item\end{CompactList}\end{CompactItemize}
\subsection*{Enumerations}
\begin{CompactItemize}
\item 
enum \hyperlink{FORK_8c_a11}{\_\-FORK\_\-msg\_\-type} \{ {\bf FORK\_\-K\_\-MSG\_\-TYPE\_\-USR} =  0, 
{\bf FORK\_\-K\_\-MSG\_\-TYPE\_\-SYS} =  1
 \}
\begin{CompactList}\small\item\em Distinguishes between the two types of messages, user or system.\item\end{CompactList}\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
int \hyperlink{FORK_8c_a3}{FORK\_\-pend} (\hyperlink{FORK_8h_a0}{FORK\_\-fcb} $\ast$fcb)
\begin{CompactList}\small\item\em This is an internal routine used by the FORK servicing task.\item\end{CompactList}\item 
void \hyperlink{FORK_8c_a4}{create\_\-list} (\hyperlink{LLI__pubdefs_8h_a1}{LLI\_\-list} $\ast$list, \hyperlink{FORK_8h_a2}{FORK\_\-msg\_\-sys} $\ast$msgs, int cnt, \hyperlink{FORK_8h_a3}{FORK\_\-type} type)
\begin{CompactList}\small\item\em Internal routine to initialize the system pool of messages.\item\end{CompactList}\item 
int \hyperlink{FORK_8c_a5}{que} (\hyperlink{FORK_8h_a0}{FORK\_\-fcb} $\ast$fcb, \hyperlink{FORK_8h_a6}{FORK\_\-cb\_\-rtn} handler, \hyperlink{FORK_8h_a1}{FORK\_\-msg\_\-hdr} $\ast$msg, \hyperlink{FORK_8c_a0}{FORK\_\-msg\_\-type} msg\_\-type)
\begin{CompactList}\small\item\em Internal routine to que a message for servicing.\item\end{CompactList}\item 
\hypertarget{FORK_8c_a6}{
\index{FORK_fcb_sizeof@{FORK\_\-fcb\_\-sizeof}!FORK.c@{FORK.c}}\index{FORK.c@{FORK.c}!FORK_fcb_sizeof@{FORK\_\-fcb\_\-sizeof}}
int {\bf FORK\_\-fcb\_\-sizeof} (void)}
\label{FORK_8c_a6}

\item 
\hypertarget{FORK_8c_a7}{
\index{FORK_create@{FORK\_\-create}!FORK.c@{FORK.c}}\index{FORK.c@{FORK.c}!FORK_create@{FORK\_\-create}}
int {\bf FORK\_\-create} (\hyperlink{FORK_8h_a0}{FORK\_\-fcb} $\ast$fcb, \hyperlink{FORK_8h_a6}{FORK\_\-cb\_\-rtn} def\_\-handler, \hyperlink{FORK_8h_a5}{FORK\_\-cb\_\-prm} ctx, \hyperlink{FORK_8h_a5}{FORK\_\-cb\_\-prm} tmo\_\-ctx, int tmo, \hyperlink{FORK_8h_a2}{FORK\_\-msg\_\-sys} $\ast$msg\_\-blks, int msg\_\-cnt, \hyperlink{FORK_8h_a3}{FORK\_\-type} type, const TASK\_\-attr $\ast$attributes)}
\label{FORK_8c_a7}

\item 
\hypertarget{FORK_8c_a8}{
\index{FORK_destroy@{FORK\_\-destroy}!FORK.c@{FORK.c}}\index{FORK.c@{FORK.c}!FORK_destroy@{FORK\_\-destroy}}
int {\bf FORK\_\-destroy} (\hyperlink{FORK_8h_a0}{FORK\_\-fcb} $\ast$fcb)}
\label{FORK_8c_a8}

\item 
\hypertarget{FORK_8c_a9}{
\index{FORK_qsys@{FORK\_\-qsys}!FORK.c@{FORK.c}}\index{FORK.c@{FORK.c}!FORK_qsys@{FORK\_\-qsys}}
int {\bf FORK\_\-qsys} (\hyperlink{FORK_8h_a0}{FORK\_\-fcb} $\ast$fcb, \hyperlink{FORK_8h_a6}{FORK\_\-cb\_\-rtn} handler, void $\ast$contents, int tmo)}
\label{FORK_8c_a9}

\item 
\hypertarget{FORK_8c_a10}{
\index{FORK_qusr@{FORK\_\-qusr}!FORK.c@{FORK.c}}\index{FORK.c@{FORK.c}!FORK_qusr@{FORK\_\-qusr}}
int {\bf FORK\_\-qusr} (\hyperlink{FORK_8h_a0}{FORK\_\-fcb} $\ast$fcb, \hyperlink{FORK_8h_a6}{FORK\_\-cb\_\-rtn} handler, \hyperlink{FORK_8h_a1}{FORK\_\-msg\_\-hdr} $\ast$msg)}
\label{FORK_8c_a10}

\end{CompactItemize}


\subsection{Detailed Description}
The FORK routines.





\subsection{Function Documentation}
\hypertarget{FORK_8c_a4}{
\index{FORK.c@{FORK.c}!create_list@{create\_\-list}}
\index{create_list@{create\_\-list}!FORK.c@{FORK.c}}
\subsubsection[create\_\-list]{\setlength{\rightskip}{0pt plus 5cm}void create\_\-list (\hyperlink{LLI__pubdefs_8h_a1}{LLI\_\-list} $\ast$ {\em list}, \hyperlink{FORK_8h_a2}{FORK\_\-msg\_\-sys} $\ast$ {\em msgs}, int {\em cnt}, \hyperlink{FORK_8h_a3}{FORK\_\-type} {\em type})\hspace{0.3cm}{\tt  \mbox{[}inline, static\mbox{]}}}}
\label{FORK_8c_a4}


Internal routine to initialize the system pool of messages.

\begin{Desc}
\item[Parameters: ]\par
\begin{description}
\item[{\em 
list}]The list  \item[{\em 
msgs}]The array of messages to place on the que \item[{\em 
cnt}]The number of messages to place on the que \item[{\em 
type}]The type of blocking to use on the create pool. \end{description}
\end{Desc}
\hypertarget{FORK_8c_a3}{
\index{FORK.c@{FORK.c}!FORK_pend@{FORK\_\-pend}}
\index{FORK_pend@{FORK\_\-pend}!FORK.c@{FORK.c}}
\subsubsection[FORK\_\-pend]{\setlength{\rightskip}{0pt plus 5cm}int FORK\_\-pend (\hyperlink{FORK_8h_a0}{FORK\_\-fcb} $\ast$ {\em fcb})}}
\label{FORK_8c_a3}


This is an internal routine used by the FORK servicing task.



 \begin{Desc}
\item[Parameters: ]\par
\begin{description}
\item[{\em 
fcb}]The FORK Control Block \end{description}
\end{Desc}
\begin{Desc}
\item[Returns: ]\par
Status\end{Desc}
This is an internal routine used by the FORK servicing task to receive and dispatch messages to the appropriate handler. \hypertarget{FORK_8c_a5}{
\index{FORK.c@{FORK.c}!que@{que}}
\index{que@{que}!FORK.c@{FORK.c}}
\subsubsection[que]{\setlength{\rightskip}{0pt plus 5cm}int que (\hyperlink{FORK_8h_a0}{FORK\_\-fcb} $\ast$ {\em fcb}, \hyperlink{FORK_8h_a6}{FORK\_\-cb\_\-rtn} {\em handler}, \hyperlink{FORK_8h_a1}{FORK\_\-msg\_\-hdr} $\ast$ {\em msg}, \hyperlink{FORK_8c_a0}{FORK\_\-msg\_\-type} {\em msg\_\-type})\hspace{0.3cm}{\tt  \mbox{[}inline, static\mbox{]}}}}
\label{FORK_8c_a5}


Internal routine to que a message for servicing.

\begin{Desc}
\item[Parameters: ]\par
\begin{description}
\item[{\em 
fcb}]The FORK Control Block to que the message to. \item[{\em 
handler}]The address of the routine to the message \item[{\em 
msg}]The message to que. \item[{\em 
msg\_\-type}]The message type that is being queued, ie user or system \end{description}
\end{Desc}
\begin{Desc}
\item[Returns: ]\par
Status \end{Desc}
