\hypertarget{FORK_8h}{
\section{FORK.h File Reference}
\label{FORK_8h}\index{FORK.h@{FORK.h}}
}
Fork an execution thread, create and manage buffered queues between two tasks. 

{\tt \#include \char`\"{}IPBS/LI\_\-pubdefs.h\char`\"{}}\par
{\tt \#include \char`\"{}IPBS/PL\_\-comdefs.h\char`\"{}}\par
{\tt \#include \char`\"{}IPBS/TOC\_\-comdefs.h\char`\"{}}\par


Include dependency graph for FORK.h:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=345pt]{FORK_8h__incl}
\end{center}
\end{figure}


This graph shows which files directly or indirectly include this file:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=95pt]{FORK_8h__dep__incl}
\end{center}
\end{figure}
\subsection*{Data Structures}
\begin{CompactItemize}
\item 
union \hyperlink{union__FORK__node}{\_\-FORK\_\-node}
\begin{CompactList}\small\item\em Structure defining a FORK\_\-node. \item\end{CompactList}\item 
struct \hyperlink{struct__FORK__msg__hdr}{\_\-FORK\_\-msg\_\-hdr}
\begin{CompactList}\small\item\em All messages queued by the FORK routines must be prefaced by this controlling structure. \item\end{CompactList}\item 
struct \hyperlink{struct__FORK__msg__sys}{\_\-FORK\_\-msg\_\-sys}
\begin{CompactList}\small\item\em A predefined message consisting of a FORK\_\-msg\_\-hdr and a single 32-bit location to hold the contents. \item\end{CompactList}\item 
struct \hyperlink{struct__FORK__que__cfg}{\_\-FORK\_\-que\_\-cfg}
\begin{CompactList}\small\item\em Describes the configuration of a que. \item\end{CompactList}\end{CompactItemize}
\subsection*{Typedefs}
\begin{CompactItemize}
\item 
\hypertarget{FORK_8h_a1}{
typedef \hyperlink{struct__FORK__msg__hdr}{\_\-FORK\_\-msg\_\-hdr} \hyperlink{FORK_8h_a1}{FORK\_\-msg\_\-hdr}}
\label{FORK_8h_a1}

\begin{CompactList}\small\item\em Typedef for struct \hyperlink{struct__FORK__msg__hdr}{\_\-FORK\_\-msg\_\-hdr}. \item\end{CompactList}\item 
\hypertarget{FORK_8h_a2}{
typedef \hyperlink{union__FORK__que}{\_\-FORK\_\-que} \hyperlink{FORK_8h_a2}{FORK\_\-que}}
\label{FORK_8h_a2}

\begin{CompactList}\small\item\em Typedef for a FORK que. To the user this is an opaque handle. \item\end{CompactList}\item 
\hypertarget{FORK_8h_a3}{
typedef enum \hyperlink{FORK_8h_a40}{\_\-FORK\_\-type} \hyperlink{FORK_8h_a3}{FORK\_\-type}}
\label{FORK_8h_a3}

\begin{CompactList}\small\item\em Typedef for the enum \_\-FORK\_\-type. \item\end{CompactList}\item 
\hypertarget{FORK_8h_a4}{
typedef enum \hyperlink{FORK_8h_a41}{\_\-FORK\_\-cb\_\-status} \hyperlink{FORK_8h_a4}{FORK\_\-cb\_\-status}}
\label{FORK_8h_a4}

\begin{CompactList}\small\item\em Typedef for enum \_\-FORK\_\-cb\_\-status. \item\end{CompactList}\item 
typedef void $\ast$ \hyperlink{FORK_8h_a5}{FORK\_\-cb\_\-prm}
\begin{CompactList}\small\item\em Typedef for the FORK callback parameter. \item\end{CompactList}\item 
typedef \hyperlink{FORK_8h_a4}{FORK\_\-cb\_\-status}($\ast$ \hyperlink{FORK_8h_a6}{FORK\_\-cb\_\-rtn} )(\hyperlink{FORK_8h_a5}{FORK\_\-cb\_\-prm} context, \hyperlink{struct__FORK__msg__hdr}{FORK\_\-msg\_\-hdr} $\ast$msg\_\-hdr)
\begin{CompactList}\small\item\em Signature of the FORK callback handler. \item\end{CompactList}\item 
typedef int($\ast$ \hyperlink{FORK_8h_a7}{FORK\_\-cb\_\-modify} )(\hyperlink{FORK_8h_a5}{FORK\_\-cb\_\-prm} context, \hyperlink{struct__FORK__msg__hdr}{FORK\_\-msg\_\-hdr} $\ast$msg\_\-hdr)
\begin{CompactList}\small\item\em Signature of the FORK modify callback handler. \item\end{CompactList}\item 
typedef \hyperlink{union__FORK__node}{\_\-FORK\_\-node} \hyperlink{FORK_8h_a8}{FORK\_\-node}
\begin{CompactList}\small\item\em Typedef for a FORK\_\-node. \item\end{CompactList}\item 
typedef \hyperlink{struct__FORK__msg__sys}{\_\-FORK\_\-msg\_\-sys} \hyperlink{FORK_8h_a9}{FORK\_\-msg\_\-sys}
\begin{CompactList}\small\item\em Typedef for struct \hyperlink{struct__FORK__msg__sys}{\_\-FORK\_\-msg\_\-sys}. \item\end{CompactList}\item 
typedef \hyperlink{struct__FORK__que__cfg}{\_\-FORK\_\-que\_\-cfg} \hyperlink{FORK_8h_a10}{FORK\_\-que\_\-cfg}
\begin{CompactList}\small\item\em Typedef for struct {\em \hyperlink{struct__FORK__que__cfg}{\_\-FORK\_\-que\_\-cfg}\/}. \item\end{CompactList}\item 
\hypertarget{FORK_8h_a11}{
typedef \hyperlink{PL__comdefs_8h_a0}{PL\_\-list} \hyperlink{FORK_8h_a11}{FORK\_\-que\_\-list}}
\label{FORK_8h_a11}

\begin{CompactList}\small\item\em Used to enable and disable lists of ques. \item\end{CompactList}\item 
typedef \hyperlink{struct__FORK__fcb}{\_\-FORK\_\-fcb} \hyperlink{FORK_8h_a12}{FORK\_\-fcb}
\begin{CompactList}\small\item\em Typedef for struct \hyperlink{struct__FORK__fcb}{\_\-FORK\_\-fcb}. \item\end{CompactList}\end{CompactItemize}
\subsection*{Enumerations}
\begin{CompactItemize}
\item 
enum \hyperlink{FORK_8h_a40}{\_\-FORK\_\-type} \{ \par
\hyperlink{FORK_8h_a40a13}{FORK\_\-K\_\-TYPE\_\-LOCKING\_\-ONLY} =  RW\_\-K\_\-TYPE\_\-LOCKING\_\-ONLY, 
\par
\hyperlink{FORK_8h_a40a14}{FORK\_\-K\_\-TYPE\_\-PENDING} =  RW\_\-K\_\-TYPE\_\-PENDING, 
\par
\hyperlink{FORK_8h_a40a15}{FORK\_\-K\_\-TYPE\_\-PENDING\_\-WTO} =  RW\_\-K\_\-TYPE\_\-PENDING\_\-WTO, 
\par
\hyperlink{FORK_8h_a40a16}{FORK\_\-K\_\-TYPE\_\-PENDING\_\-FIFO} =  RW\_\-K\_\-TYPE\_\-PENDING\_\-FIFO, 
\par
\hyperlink{FORK_8h_a40a17}{FORK\_\-K\_\-TYPE\_\-PENDING\_\-FIFO\_\-WTO} =  RW\_\-K\_\-TYPE\_\-PENDING\_\-FIFO\_\-WTO, 
\par
\hyperlink{FORK_8h_a40a18}{FORK\_\-K\_\-TYPE\_\-PENDING\_\-PRIORITY} =  RW\_\-K\_\-TYPE\_\-PENDING\_\-PRIORITY, 
\par
\hyperlink{FORK_8h_a40a19}{FORK\_\-K\_\-TYPE\_\-PENDING\_\-PRIORITY\_\-WTO} =  RW\_\-K\_\-TYPE\_\-PENDING\_\-PRIORITY\_\-WTO
 \}
\begin{CompactList}\small\item\em Enumerates the different pending types. This determines the behaviour when one attempts to allocate a system message from an empty list. \item\end{CompactList}\item 
enum \hyperlink{FORK_8h_a41}{\_\-FORK\_\-cb\_\-status} \{ \hyperlink{FORK_8h_a41a20}{FORK\_\-C\_\-CONTINUE} =  0
 \}
\begin{CompactList}\small\item\em Enumerates the status of the call back routine. \item\end{CompactList}\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
int \hyperlink{FORK_8h_a21}{FORK\_\-fcb\_\-sizeof} (int nques)
\begin{CompactList}\small\item\em Returns the size, in bytes, of a FORK Control Block. \item\end{CompactList}\item 
int \hyperlink{FORK_8h_a22}{FORK\_\-create} (\hyperlink{struct__FORK__fcb}{FORK\_\-fcb} $\ast$fcb, const struct \hyperlink{struct__TASK__attr}{\_\-TASK\_\-attr} $\ast$attr, \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, const \hyperlink{struct__TOC}{TOC} $\ast$tmo\_\-toc, int nques, const \hyperlink{struct__FORK__que__cfg}{FORK\_\-que\_\-cfg} $\ast$que\_\-cfg, \hyperlink{FORK_8h_a3}{FORK\_\-type} msg\_\-type, \hyperlink{struct__FORK__msg__sys}{FORK\_\-msg\_\-sys} $\ast$msg\_\-blks, int msg\_\-cnt)
\begin{CompactList}\small\item\em Creates a FORK message que. \item\end{CompactList}\item 
int \hyperlink{FORK_8h_a23}{FORK\_\-destroy} (\hyperlink{struct__FORK__fcb}{FORK\_\-fcb} $\ast$fcb)
\begin{CompactList}\small\item\em Destroys a FORK que. \item\end{CompactList}\item 
\hyperlink{FORK_8h_a11}{FORK\_\-que\_\-list} \hyperlink{FORK_8h_a24}{FORK\_\-disable} (\hyperlink{struct__FORK__fcb}{FORK\_\-fcb} $\ast$fcb, \hyperlink{FORK_8h_a11}{FORK\_\-que\_\-list} disable\_\-list)
\begin{CompactList}\small\item\em Disables the servicing of the specified ques. \item\end{CompactList}\item 
\hyperlink{FORK_8h_a11}{FORK\_\-que\_\-list} \hyperlink{FORK_8h_a25}{FORK\_\-enable} (\hyperlink{struct__FORK__fcb}{FORK\_\-fcb} $\ast$fcb, \hyperlink{FORK_8h_a11}{FORK\_\-que\_\-list} enable\_\-list)
\begin{CompactList}\small\item\em Enables the servicing of the specified ques. \item\end{CompactList}\item 
\hyperlink{FORK_8h_a11}{FORK\_\-que\_\-list} \hyperlink{FORK_8h_a26}{FORK\_\-enabled} (const \hyperlink{struct__FORK__fcb}{FORK\_\-fcb} $\ast$fcb)
\begin{CompactList}\small\item\em Returns the enable/disabled state of the specified que. \item\end{CompactList}\item 
int \hyperlink{FORK_8h_a27}{FORK\_\-join} (\hyperlink{struct__FORK__fcb}{FORK\_\-fcb} $\ast$fcb, int $\ast$exit\_\-status)
\begin{CompactList}\small\item\em Waits until the FORK'd task is deleted. \item\end{CompactList}\item 
int \hyperlink{FORK_8h_a28}{FORK\_\-qdisable} (\hyperlink{union__FORK__que}{FORK\_\-que} $\ast$que)
\begin{CompactList}\small\item\em Disables the servicing of the specified que. \item\end{CompactList}\item 
int \hyperlink{FORK_8h_a29}{FORK\_\-qenable} (\hyperlink{union__FORK__que}{FORK\_\-que} $\ast$que)
\begin{CompactList}\small\item\em Enables the servicing of the specified que. \item\end{CompactList}\item 
int \hyperlink{FORK_8h_a30}{FORK\_\-qenabled} (const \hyperlink{union__FORK__que}{FORK\_\-que} $\ast$que)
\begin{CompactList}\small\item\em Returns the enable/disabled state of all ques. \item\end{CompactList}\item 
int \hyperlink{FORK_8h_a31}{FORK\_\-qtail\_\-modify} (\hyperlink{union__FORK__que}{FORK\_\-que} $\ast$que, \hyperlink{FORK_8h_a7}{FORK\_\-cb\_\-modify} modify, void $\ast$parameter)
\begin{CompactList}\small\item\em Sneaky way to modify the tail (newest) element on the specified FORK que. \item\end{CompactList}\item 
int \hyperlink{FORK_8h_a32}{FORK\_\-qhead\_\-modify} (\hyperlink{union__FORK__que}{FORK\_\-que} $\ast$que, \hyperlink{FORK_8h_a7}{FORK\_\-cb\_\-modify} modify, void $\ast$parameter)
\begin{CompactList}\small\item\em Sneaky way to modify the head (oldest) element on the specified FORK que. \item\end{CompactList}\item 
int \hyperlink{FORK_8h_a33}{FORK\_\-qsys} (\hyperlink{union__FORK__que}{FORK\_\-que} $\ast$que, \hyperlink{FORK_8h_a6}{FORK\_\-cb\_\-rtn} handler, void $\ast$contents)
\begin{CompactList}\small\item\em Ques a message using the internal FORK message blocks. \item\end{CompactList}\item 
int \hyperlink{FORK_8h_a34}{FORK\_\-qsys\-W} (\hyperlink{union__FORK__que}{FORK\_\-que} $\ast$que, \hyperlink{FORK_8h_a6}{FORK\_\-cb\_\-rtn} handler, void $\ast$contents)
\begin{CompactList}\small\item\em Ques a message using the internal FORK message blocks. \item\end{CompactList}\item 
int \hyperlink{FORK_8h_a35}{FORK\_\-qsys\-W\_\-toc} (\hyperlink{union__FORK__que}{FORK\_\-que} $\ast$que, \hyperlink{FORK_8h_a6}{FORK\_\-cb\_\-rtn} handler, void $\ast$contents, const \hyperlink{struct__TOC}{TOC} $\ast$tmo\_\-toc)
\begin{CompactList}\small\item\em Ques a message using the internal FORK message blocks. \item\end{CompactList}\item 
int \hyperlink{FORK_8h_a36}{FORK\_\-qusr} (\hyperlink{union__FORK__que}{FORK\_\-que} $\ast$que, \hyperlink{FORK_8h_a6}{FORK\_\-cb\_\-rtn} handler, \hyperlink{struct__FORK__msg__hdr}{FORK\_\-msg\_\-hdr} $\ast$msg\_\-hdr)
\begin{CompactList}\small\item\em Ques a user composed message. \item\end{CompactList}\item 
int \hyperlink{FORK_8h_a37}{FORK\_\-resume} (\hyperlink{struct__FORK__fcb}{FORK\_\-fcb} $\ast$fcb)
\begin{CompactList}\small\item\em Resumes a previously suspended FORK task. \item\end{CompactList}\item 
int \hyperlink{FORK_8h_a38}{FORK\_\-suspend} (\hyperlink{struct__FORK__fcb}{FORK\_\-fcb} $\ast$fcb)
\begin{CompactList}\small\item\em Suspends the FORK task. \item\end{CompactList}\item 
\hyperlink{union__FORK__que}{FORK\_\-que} $\ast$ \hyperlink{FORK_8h_a39}{FORK\_\-que\_\-get} (\hyperlink{struct__FORK__fcb}{FORK\_\-fcb} $\ast$fcb, int que\_\-id)
\begin{CompactList}\small\item\em Returns a handle to the specified que. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Fork an execution thread, create and manage buffered queues between two tasks. 

\begin{Desc}
\item[Author:]JJRussell - \href{mailto:russell@slac.stanford.edu}{\tt russell@slac.stanford.edu}\end{Desc}


\footnotesize\begin{verbatim}   CVS $Id: FORK.h,v 1.1.1.1 2006/02/10 21:45:35 saxton Exp $
\end{verbatim}
\normalsize


\subsection{Typedef Documentation}
\hypertarget{FORK_8h_a7}{
\index{FORK.h@{FORK.h}!FORK_cb_modify@{FORK\_\-cb\_\-modify}}
\index{FORK_cb_modify@{FORK\_\-cb\_\-modify}!FORK.h@{FORK.h}}
\subsubsection[FORK\_\-cb\_\-modify]{\setlength{\rightskip}{0pt plus 5cm}\hyperlink{FORK_8h_a7}{FORK\_\-cb\_\-modify}}}
\label{FORK_8h_a7}


Signature of the FORK modify callback handler. 

Defines the signature for the user callback \& parameter



\footnotesize\begin{verbatim}        ret_code = (*cb_rtn) (FORK_cb_prm cb_prm, FORK_msg_hdr *msg_hdr)
        
   Where:
          cb_prm: The value of the context parameter passed into the
                  FORK_qxxxx_modify routine.
  
         msg_hdr: A pointer to the message header of the message to
                  be modified. This pointer will, in all likelihood,
                  be recasted by the into a pointer to the specific
                  style of message the user is expecting.

        ret_code: An arbitrary 32-bit integer passed back to the caller
                  of FORK_qhead_modify() or FORK_qtail_modify().
  
                                     
  \end{verbatim}
\normalsize


\begin{Desc}
\item[Warning:]It should be stated that this callback routine is done with the que locked. Depending on the implementation, locking the que may be implemented by disabling interrupts. With this in mind, the user is encouraged to get in and out of this routine as quickly as possible.\end{Desc}
\hypertarget{FORK_8h_a5}{
\index{FORK.h@{FORK.h}!FORK_cb_prm@{FORK\_\-cb\_\-prm}}
\index{FORK_cb_prm@{FORK\_\-cb\_\-prm}!FORK.h@{FORK.h}}
\subsubsection[FORK\_\-cb\_\-prm]{\setlength{\rightskip}{0pt plus 5cm}\hyperlink{FORK_8h_a5}{FORK\_\-cb\_\-prm}}}
\label{FORK_8h_a5}


Typedef for the FORK callback parameter. 

This parameter is specified when calling \hyperlink{FORK_8c_a5}{FORK\_\-create()} and is passed transparently into the user's callback handler.\hypertarget{FORK_8h_a6}{
\index{FORK.h@{FORK.h}!FORK_cb_rtn@{FORK\_\-cb\_\-rtn}}
\index{FORK_cb_rtn@{FORK\_\-cb\_\-rtn}!FORK.h@{FORK.h}}
\subsubsection[FORK\_\-cb\_\-rtn]{\setlength{\rightskip}{0pt plus 5cm}\hyperlink{FORK_8h_a6}{FORK\_\-cb\_\-rtn}}}
\label{FORK_8h_a6}


Signature of the FORK callback handler. 

Defines the signature for the user callback \& parameter



\footnotesize\begin{verbatim}        status = (*cb_rtn) (FORK_cb_prm cb_prm, FORK_msg_hdr *msg_hdr)
        
   Where:
          cb_prm: The value of the context parameter passed into the
                  FORK_create routines.
  
         msg_hdr: A pointer to the message header. This pointer will,
                  in all likelihood, be recasted into a pointer to
                  the specific style of message one is expecting.
  
  
    RETURN VALUE: FORK_C_CONTINUE 0), keep going, anything else
                  kill the FORK process.  

                   
  \end{verbatim}
\normalsize
\hypertarget{FORK_8h_a12}{
\index{FORK.h@{FORK.h}!FORK_fcb@{FORK\_\-fcb}}
\index{FORK_fcb@{FORK\_\-fcb}!FORK.h@{FORK.h}}
\subsubsection[FORK\_\-fcb]{\setlength{\rightskip}{0pt plus 5cm}\hyperlink{struct__FORK__fcb}{FORK\_\-fcb}}}
\label{FORK_8h_a12}


Typedef for struct \hyperlink{struct__FORK__fcb}{\_\-FORK\_\-fcb}. 

This block contains all the one time initialization parameters and serves as the caller's handle to the create FORK que. The free message list is used if and only if the user requests the creation of an internal que.\hypertarget{FORK_8h_a9}{
\index{FORK.h@{FORK.h}!FORK_msg_sys@{FORK\_\-msg\_\-sys}}
\index{FORK_msg_sys@{FORK\_\-msg\_\-sys}!FORK.h@{FORK.h}}
\subsubsection[FORK\_\-msg\_\-sys]{\setlength{\rightskip}{0pt plus 5cm}\hyperlink{struct__FORK__msg__sys}{FORK\_\-msg\_\-sys}}}
\label{FORK_8h_a9}


Typedef for struct \hyperlink{struct__FORK__msg__sys}{\_\-FORK\_\-msg\_\-sys}. 

This is a the message that is queued by the FORK\_\-qsys\-XXX's routine. It consists of about the minimal usable message, a message header and one 4 byte location to store the message contents in.\hypertarget{FORK_8h_a8}{
\index{FORK.h@{FORK.h}!FORK_node@{FORK\_\-node}}
\index{FORK_node@{FORK\_\-node}!FORK.h@{FORK.h}}
\subsubsection[FORK\_\-node]{\setlength{\rightskip}{0pt plus 5cm}\hyperlink{union__FORK__node}{FORK\_\-node}}}
\label{FORK_8h_a8}


Typedef for a FORK\_\-node. 

\begin{Desc}
\item[Warning:]This is an internal union needed only to define a message header. The user never needs to manipulate this structure directly.\end{Desc}
\hypertarget{FORK_8h_a10}{
\index{FORK.h@{FORK.h}!FORK_que_cfg@{FORK\_\-que\_\-cfg}}
\index{FORK_que_cfg@{FORK\_\-que\_\-cfg}!FORK.h@{FORK.h}}
\subsubsection[FORK\_\-que\_\-cfg]{\setlength{\rightskip}{0pt plus 5cm}\hyperlink{struct__FORK__que__cfg}{FORK\_\-que\_\-cfg}}}
\label{FORK_8h_a10}


Typedef for struct {\em \hyperlink{struct__FORK__que__cfg}{\_\-FORK\_\-que\_\-cfg}\/}. 

This describes the properties of a que when the FORK facility is setup to handle multiple ques. This includes a default callback routine and parameter to be associated with the que.

\subsection{Enumeration Type Documentation}
\hypertarget{FORK_8h_a41}{
\index{FORK.h@{FORK.h}!_FORK_cb_status@{\_\-FORK\_\-cb\_\-status}}
\index{_FORK_cb_status@{\_\-FORK\_\-cb\_\-status}!FORK.h@{FORK.h}}
\subsubsection[\_\-FORK\_\-cb\_\-status]{\setlength{\rightskip}{0pt plus 5cm}enum \hyperlink{FORK_8h_a41}{\_\-FORK\_\-cb\_\-status}}}
\label{FORK_8h_a41}


Enumerates the status of the call back routine. 

This enumerates the return value of the user's dispatch callback handler. Any value but FORK\_\-C\_\-CONTINUE (0) causes the FORK'd task to delete itself.\begin{Desc}
\item[Enumerator: ]\par
\begin{description}
\index{FORK_C_CONTINUE@{FORK\_\-C\_\-CONTINUE}!FORK.h@{FORK.h}}\index{FORK.h@{FORK.h}!FORK_C_CONTINUE@{FORK\_\-C\_\-CONTINUE}}\item[{\em 
\hypertarget{FORK_8h_a41a20}{
FORK\_\-C\_\-CONTINUE}
\label{FORK_8h_a41a20}
}]Continue normal processing \end{description}
\end{Desc}

\hypertarget{FORK_8h_a40}{
\index{FORK.h@{FORK.h}!_FORK_type@{\_\-FORK\_\-type}}
\index{_FORK_type@{\_\-FORK\_\-type}!FORK.h@{FORK.h}}
\subsubsection[\_\-FORK\_\-type]{\setlength{\rightskip}{0pt plus 5cm}enum \hyperlink{FORK_8h_a40}{\_\-FORK\_\-type}}}
\label{FORK_8h_a40}


Enumerates the different pending types. This determines the behaviour when one attempts to allocate a system message from an empty list. 

\begin{Desc}
\item[Enumerator: ]\par
\begin{description}
\index{FORK_K_TYPE_LOCKING_ONLY@{FORK\_\-K\_\-TYPE\_\-LOCKING\_\-ONLY}!FORK.h@{FORK.h}}\index{FORK.h@{FORK.h}!FORK_K_TYPE_LOCKING_ONLY@{FORK\_\-K\_\-TYPE\_\-LOCKING\_\-ONLY}}\item[{\em 
\hypertarget{FORK_8h_a40a13}{
FORK\_\-K\_\-TYPE\_\-LOCKING\_\-ONLY}
\label{FORK_8h_a40a13}
}]Locking mechanism only, no pending mechanism available \index{FORK_K_TYPE_PENDING@{FORK\_\-K\_\-TYPE\_\-PENDING}!FORK.h@{FORK.h}}\index{FORK.h@{FORK.h}!FORK_K_TYPE_PENDING@{FORK\_\-K\_\-TYPE\_\-PENDING}}\item[{\em 
\hypertarget{FORK_8h_a40a14}{
FORK\_\-K\_\-TYPE\_\-PENDING}
\label{FORK_8h_a40a14}
}]Pending mechanism available, single pender/reader only \index{FORK_K_TYPE_PENDING_WTO@{FORK\_\-K\_\-TYPE\_\-PENDING\_\-WTO}!FORK.h@{FORK.h}}\index{FORK.h@{FORK.h}!FORK_K_TYPE_PENDING_WTO@{FORK\_\-K\_\-TYPE\_\-PENDING\_\-WTO}}\item[{\em 
\hypertarget{FORK_8h_a40a15}{
FORK\_\-K\_\-TYPE\_\-PENDING\_\-WTO}
\label{FORK_8h_a40a15}
}]Pending with timeouts, single pender/reader only \index{FORK_K_TYPE_PENDING_FIFO@{FORK\_\-K\_\-TYPE\_\-PENDING\_\-FIFO}!FORK.h@{FORK.h}}\index{FORK.h@{FORK.h}!FORK_K_TYPE_PENDING_FIFO@{FORK\_\-K\_\-TYPE\_\-PENDING\_\-FIFO}}\item[{\em 
\hypertarget{FORK_8h_a40a16}{
FORK\_\-K\_\-TYPE\_\-PENDING\_\-FIFO}
\label{FORK_8h_a40a16}
}]Use FIFO pending order \index{FORK_K_TYPE_PENDING_FIFO_WTO@{FORK\_\-K\_\-TYPE\_\-PENDING\_\-FIFO\_\-WTO}!FORK.h@{FORK.h}}\index{FORK.h@{FORK.h}!FORK_K_TYPE_PENDING_FIFO_WTO@{FORK\_\-K\_\-TYPE\_\-PENDING\_\-FIFO\_\-WTO}}\item[{\em 
\hypertarget{FORK_8h_a40a17}{
FORK\_\-K\_\-TYPE\_\-PENDING\_\-FIFO\_\-WTO}
\label{FORK_8h_a40a17}
}]Use FIFO pending order with timeouts available \index{FORK_K_TYPE_PENDING_PRIORITY@{FORK\_\-K\_\-TYPE\_\-PENDING\_\-PRIORITY}!FORK.h@{FORK.h}}\index{FORK.h@{FORK.h}!FORK_K_TYPE_PENDING_PRIORITY@{FORK\_\-K\_\-TYPE\_\-PENDING\_\-PRIORITY}}\item[{\em 
\hypertarget{FORK_8h_a40a18}{
FORK\_\-K\_\-TYPE\_\-PENDING\_\-PRIORITY}
\label{FORK_8h_a40a18}
}]Use PRIORITY pending order \index{FORK_K_TYPE_PENDING_PRIORITY_WTO@{FORK\_\-K\_\-TYPE\_\-PENDING\_\-PRIORITY\_\-WTO}!FORK.h@{FORK.h}}\index{FORK.h@{FORK.h}!FORK_K_TYPE_PENDING_PRIORITY_WTO@{FORK\_\-K\_\-TYPE\_\-PENDING\_\-PRIORITY\_\-WTO}}\item[{\em 
\hypertarget{FORK_8h_a40a19}{
FORK\_\-K\_\-TYPE\_\-PENDING\_\-PRIORITY\_\-WTO}
\label{FORK_8h_a40a19}
}]Use PRIORITY pending order with timeouts available \end{description}
\end{Desc}



\subsection{Function Documentation}
\hypertarget{FORK_8h_a22}{
\index{FORK.h@{FORK.h}!FORK_create@{FORK\_\-create}}
\index{FORK_create@{FORK\_\-create}!FORK.h@{FORK.h}}
\subsubsection[FORK\_\-create]{\setlength{\rightskip}{0pt plus 5cm}int FORK\_\-create (\hyperlink{struct__FORK__fcb}{FORK\_\-fcb} $\ast$ {\em fcb}, const struct \hyperlink{struct__TASK__attr}{\_\-TASK\_\-attr} $\ast$ {\em attributes}, \hyperlink{FORK_8h_a6}{FORK\_\-cb\_\-rtn} {\em def\_\-handler}, \hyperlink{FORK_8h_a5}{FORK\_\-cb\_\-prm} {\em ctx}, \hyperlink{FORK_8h_a5}{FORK\_\-cb\_\-prm} {\em tmo\_\-ctx}, const \hyperlink{struct__TOC}{TOC} $\ast$ {\em tmo\_\-toc}, int {\em nques}, const \hyperlink{struct__FORK__que__cfg}{FORK\_\-que\_\-cfg} $\ast$ {\em que\_\-cfg}, \hyperlink{FORK_8h_a3}{FORK\_\-type} {\em msg\_\-type}, \hyperlink{struct__FORK__msg__sys}{FORK\_\-msg\_\-sys} $\ast$ {\em msg\_\-blks}, int {\em msg\_\-cnt})}}
\label{FORK_8h_a22}


Creates a FORK message que. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em fcb}]The FORK Control Block to initialize \item[{\em attributes}]The attributes to use when creating the FORK servicing task. \item[{\em def\_\-handler}]The address of a default FORK handler. This routine will be called back in one of two circumstances.\end{description}
\end{Desc}
\begin{enumerate}
\item The user does not provide an explicit routine queing the message.\item A timeout occurs\par
\end{enumerate}


\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ctx}]Parameter passed transparently to the user's callback handler, except in the case of a timeout. \item[{\em tmo\_\-ctx}]Parameter passed transparently to the user's callback routine in case of a timeout. The user may use this parameter to distinguish a timeout condition from a normal message. (The message block will also be NULL in this case.) \item[{\em tmo\_\-toc}]Timeout control specification. This is used when a message is being pended for. If this value is TOC\_\-FOREVER, the pend is indefinite. \end{description}
\end{Desc}
\begin{Desc}
\item[Warning:]Do not pass NULL for this parameter. The standard intepretation of NULL for a timeout control block is as NO\_\-WAIT. This is almost certainly not what one wants in the FORK routines. \end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em nques}]If specified as 0 or 1, a single non-prioritized que is used. If specified as $>$1, multiple prioritized ques are used. {\em que\_\-cfg\/} configures each of the ques. \item[{\em que\_\-cfg}]An array of que configuration blocks. If {\em nques\/} is specified as 0 or 1, this parameter is ignored. If the callback routine is specified as NULL for any individual que configuration, the default callback handler is used. \item[{\em msg\_\-type}]The blocking type to use when attempting allocate a message from the system queue. There are three blocking styles. \par
\end{description}
\end{Desc}
\begin{enumerate}
\item Non-blocking, this is the equivalent of a poll and is not very useful\item Blocking without a timeout. This is the equivalent of a indefinite wait for a message.\item Blocking with a timeout. \begin{Desc}
\item[Note:]This parameter is applicable if and only if one is using a system pool to allocate messages from. Use of a system pool is determined by a non-zero message count, {\em msg\_\-cnt\/} \end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em msg\_\-blks}]A source of internal message blocks. This may be specified as NULL and is ignored if {\em msg\_\-cnt\/} is specified as 0. \end{description}
\end{Desc}
\begin{Desc}
\item[Note:]This parameter is applicable if and only if one is using a system pool to allocate messages from. Use of a system pool is determined by a non-zero message count, {\em msg\_\-cnt\/} \end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em msg\_\-cnt}]The number of {\em msg\_\-blks\/}. This may be specified as 0. In this case no system message pool is created and the values of the parameters {\em msg\_\-type\/} and msg\_\-blks are ignored.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Status\end{Desc}
This routine creates the FORK message que and its associated task. The {\em def\_\-handler\/} will be used as the callback handler when a message is queued without an explicit handler, see \hyperlink{FORK_8c_a17}{FORK\_\-qsys\-W()}, FORK\_\-qsys\-WTO(), and FORK\_\-quser(). It is also used when a timeout occurs.\end{enumerate}
\hypertarget{FORK_8h_a23}{
\index{FORK.h@{FORK.h}!FORK_destroy@{FORK\_\-destroy}}
\index{FORK_destroy@{FORK\_\-destroy}!FORK.h@{FORK.h}}
\subsubsection[FORK\_\-destroy]{\setlength{\rightskip}{0pt plus 5cm}int FORK\_\-destroy (\hyperlink{struct__FORK__fcb}{FORK\_\-fcb} $\ast$ {\em fcb})}}
\label{FORK_8h_a23}


Destroys a FORK que. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em fcb}]The Fork Control Block of the FORK que to destroy \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Status\end{Desc}
Releases all the internal resources used by the FORK que. It does not release either the memory associated with any potential internal pool of message blocks that the FORK routines may be managing on behalf of the user, nor does it release the memory associated with the Fork Control Block itself. Both these are user providef blocks of memory and, therefore, user managed blocks of memories.

The usual method of winding down the FORK task is for the parent task to send a QUIT message to the FORK'd task. The parent task then calls FORK\_\-join, which block until the FORK'd task exits. The FORK'd task performs any necessary clean-up then returns a non-zero status code from the callback routine. This causes the FORK'd task to delete itself, allowing the \hyperlink{FORK_8c_a22}{FORK\_\-join()} call to complete.

\begin{Desc}
\item[Warning:]As with all delete operations, care must be taken to ensure it is safe to destroy the FORK que. The above suggests one method of doing this.\end{Desc}
\hypertarget{FORK_8h_a24}{
\index{FORK.h@{FORK.h}!FORK_disable@{FORK\_\-disable}}
\index{FORK_disable@{FORK\_\-disable}!FORK.h@{FORK.h}}
\subsubsection[FORK\_\-disable]{\setlength{\rightskip}{0pt plus 5cm}\hyperlink{FORK_8h_a11}{FORK\_\-que\_\-list} FORK\_\-disable (\hyperlink{struct__FORK__fcb}{FORK\_\-fcb} $\ast$ {\em fcb}, \hyperlink{FORK_8h_a11}{FORK\_\-que\_\-list} {\em disable\_\-list})}}
\label{FORK_8h_a24}


Disables the servicing of the specified ques. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em fcb}]The FORK Control Block \item[{\em disable\_\-list}]The list of ques to disable \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]The list of previously of enabled ques\end{Desc}
\hypertarget{FORK_8h_a25}{
\index{FORK.h@{FORK.h}!FORK_enable@{FORK\_\-enable}}
\index{FORK_enable@{FORK\_\-enable}!FORK.h@{FORK.h}}
\subsubsection[FORK\_\-enable]{\setlength{\rightskip}{0pt plus 5cm}\hyperlink{FORK_8h_a11}{FORK\_\-que\_\-list} FORK\_\-enable (\hyperlink{struct__FORK__fcb}{FORK\_\-fcb} $\ast$ {\em fcb}, \hyperlink{FORK_8h_a11}{FORK\_\-que\_\-list} {\em enable\_\-list})}}
\label{FORK_8h_a25}


Enables the servicing of the specified ques. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em fcb}]The FORK Control Block \item[{\em enable\_\-list}]The list of ques to enable \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]The list of previously of enabled ques\end{Desc}
\hypertarget{FORK_8h_a26}{
\index{FORK.h@{FORK.h}!FORK_enabled@{FORK\_\-enabled}}
\index{FORK_enabled@{FORK\_\-enabled}!FORK.h@{FORK.h}}
\subsubsection[FORK\_\-enabled]{\setlength{\rightskip}{0pt plus 5cm}\hyperlink{FORK_8h_a11}{FORK\_\-que\_\-list} FORK\_\-enabled (const \hyperlink{struct__FORK__fcb}{FORK\_\-fcb} $\ast$ {\em fcb})}}
\label{FORK_8h_a26}


Returns the enable/disabled state of the specified que. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em fcb}]The FORK control block \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]A list of the enabled ques, MSB = que 0.\end{Desc}
\begin{Desc}
\item[Warning:]As with all queries of this type, the answer is only good until it changes. The user is cautioned on its usage. It is primarily provided as a debugging tool.\end{Desc}
\hypertarget{FORK_8h_a21}{
\index{FORK.h@{FORK.h}!FORK_fcb_sizeof@{FORK\_\-fcb\_\-sizeof}}
\index{FORK_fcb_sizeof@{FORK\_\-fcb\_\-sizeof}!FORK.h@{FORK.h}}
\subsubsection[FORK\_\-fcb\_\-sizeof]{\setlength{\rightskip}{0pt plus 5cm}int FORK\_\-fcb\_\-sizeof (int {\em nques})}}
\label{FORK_8h_a21}


Returns the size, in bytes, of a FORK Control Block. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em nques}]The number of internal ques to be supported \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]The sizeof of a fork control block\end{Desc}
Returns the size of a FORK CONTROL BLOCK. This allows the user to allocate and control the FORK CONTROL BLOCK without making its internal structure known.

The FORK routines are capable of supporting multiple prioritized internal ques. This is done by specifying {\em nques\/} to be greater than 1.\hypertarget{FORK_8h_a27}{
\index{FORK.h@{FORK.h}!FORK_join@{FORK\_\-join}}
\index{FORK_join@{FORK\_\-join}!FORK.h@{FORK.h}}
\subsubsection[FORK\_\-join]{\setlength{\rightskip}{0pt plus 5cm}int FORK\_\-join (\hyperlink{struct__FORK__fcb}{FORK\_\-fcb} $\ast$ {\em fcb}, int $\ast$ {\em exit\_\-status})}}
\label{FORK_8h_a27}


Waits until the FORK'd task is deleted. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em fcb}]The Fork Control Block \item[{\em exit\_\-status}]Returned as the exit status of the FORK'd task. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Status of the join operation.\end{Desc}
This allows the parent task to synchronize with the deletion of the FORK'd task.

The usual method of winding down the FORK task is for the parent task to send a QUIT message to the FORK'd task. The parent task then calls FORK\_\-join, which block until the FORK'd task exits. The FORK'd task performs any necessary clean-up then returns a non-zero status code from the callback routine. (This status code is returned to the user as {\em exit\_\-status\/}.) This causes the FORK'd task to delete itself, allowing the \hyperlink{FORK_8c_a22}{FORK\_\-join()} call to complete. The user is then free to call \hyperlink{FORK_8c_a7}{FORK\_\-destroy()} to return the resources garnered by the FORK fcb.

Note that the {\em exit\_\-status\/} may be returned as any non-zero 32-bit value. This includes returning a pointer to a structure which may contain additional information. If one does this, one must be careful to ensure that the memory is viable after task deletion. For instance, don't return pointers to things on the stack.\hypertarget{FORK_8h_a28}{
\index{FORK.h@{FORK.h}!FORK_qdisable@{FORK\_\-qdisable}}
\index{FORK_qdisable@{FORK\_\-qdisable}!FORK.h@{FORK.h}}
\subsubsection[FORK\_\-qdisable]{\setlength{\rightskip}{0pt plus 5cm}int FORK\_\-qdisable (\hyperlink{union__FORK__que}{FORK\_\-que} $\ast$ {\em que})}}
\label{FORK_8h_a28}


Disables the servicing of the specified que. 

\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em 0,if}]the specified que was not originally enabled !=0, if the specified que was previously enabled\end{description}
\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em que}]The FORK que to disable\end{description}
\end{Desc}
\begin{Desc}
\item[Warning:]Note that the return value is the original state of the {\bf all} enables before the qdisable was performed.\end{Desc}
\hypertarget{FORK_8h_a29}{
\index{FORK.h@{FORK.h}!FORK_qenable@{FORK\_\-qenable}}
\index{FORK_qenable@{FORK\_\-qenable}!FORK.h@{FORK.h}}
\subsubsection[FORK\_\-qenable]{\setlength{\rightskip}{0pt plus 5cm}int FORK\_\-qenable (\hyperlink{union__FORK__que}{FORK\_\-que} $\ast$ {\em que})}}
\label{FORK_8h_a29}


Enables the servicing of the specified que. 

\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em 0,if}]the specified que was not originally enabled !=0, if the specified que was previously enabled\end{description}
\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em que}]The FORK que to enable\end{description}
\end{Desc}
\hypertarget{FORK_8h_a30}{
\index{FORK.h@{FORK.h}!FORK_qenabled@{FORK\_\-qenabled}}
\index{FORK_qenabled@{FORK\_\-qenabled}!FORK.h@{FORK.h}}
\subsubsection[FORK\_\-qenabled]{\setlength{\rightskip}{0pt plus 5cm}int FORK\_\-qenabled (const \hyperlink{union__FORK__que}{FORK\_\-que} $\ast$ {\em que})}}
\label{FORK_8h_a30}


Returns the enable/disabled state of all ques. 

\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em =}]0 if the queue was previously disabled != 0 if the queue was previously enabled \end{description}
\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em que}]The que to query\end{description}
\end{Desc}
\begin{Desc}
\item[Warning:]As with all queries of this type, the answer is only good until it changes. The user is cautioned on its usage. It is primarily provided as a debugging tool.\end{Desc}
\hypertarget{FORK_8h_a32}{
\index{FORK.h@{FORK.h}!FORK_qhead_modify@{FORK\_\-qhead\_\-modify}}
\index{FORK_qhead_modify@{FORK\_\-qhead\_\-modify}!FORK.h@{FORK.h}}
\subsubsection[FORK\_\-qhead\_\-modify]{\setlength{\rightskip}{0pt plus 5cm}int FORK\_\-qhead\_\-modify (\hyperlink{union__FORK__que}{FORK\_\-que} $\ast$ {\em que}, \hyperlink{FORK_8h_a7}{FORK\_\-cb\_\-modify} {\em modify}, void $\ast$ {\em context})}}
\label{FORK_8h_a32}


Sneaky way to modify the head (oldest) element on the specified FORK que. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em que}]The target fork que. \item[{\em modify}]A callback handler used to modify the que element. The return value of this callback routine is the return value of FORK\_\-qhead\_\-modify. \end{description}
\end{Desc}
\begin{Desc}
\item[Warning:]If the que is empty, NULL is passed as the msg\_\-hdr header in the callback routine. \end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em context}]A user provided context parameter. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Whatever the user callback routine does.\end{Desc}
\hypertarget{FORK_8h_a33}{
\index{FORK.h@{FORK.h}!FORK_qsys@{FORK\_\-qsys}}
\index{FORK_qsys@{FORK\_\-qsys}!FORK.h@{FORK.h}}
\subsubsection[FORK\_\-qsys]{\setlength{\rightskip}{0pt plus 5cm}int FORK\_\-qsys (\hyperlink{union__FORK__que}{FORK\_\-que} $\ast$ {\em que}, \hyperlink{FORK_8h_a6}{FORK\_\-cb\_\-rtn} {\em handler}, void $\ast$ {\em contents})}}
\label{FORK_8h_a33}


Ques a message using the internal FORK message blocks. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em que}]The target fork que. \item[{\em handler}]A callback handler. This may be specified as NULL, in which case, the default handler established by \hyperlink{FORK_8c_a5}{FORK\_\-create()}, will handle the message. \item[{\em contents}]A single 32-bit value representing the message contents. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Status\end{Desc}
Ques a message to the FORK message que using the internal system message pool. System messages are limited to queing a single 32-bit number. Of course one can always use this to que a pointer to another data structure. The user should consider \hyperlink{FORK_8c_a19}{FORK\_\-qusr()}, to que a more complicated message without absorbing another level of indirection.

Note that because the message is internally allocated it may be possible that this list is exhausted. This version of the routine returns immediately with failure if the list is exhausted. See {\em \hyperlink{FORK_8c_a17}{FORK\_\-qsys\-W()}\/} or {\em FORK\_\-qsys\-W\_\-toc\/} for wait forever and wait with a timeout versions\hypertarget{FORK_8h_a34}{
\index{FORK.h@{FORK.h}!FORK_qsysW@{FORK\_\-qsysW}}
\index{FORK_qsysW@{FORK\_\-qsysW}!FORK.h@{FORK.h}}
\subsubsection[FORK\_\-qsysW]{\setlength{\rightskip}{0pt plus 5cm}int FORK\_\-qsys\-W (\hyperlink{union__FORK__que}{FORK\_\-que} $\ast$ {\em que}, \hyperlink{FORK_8h_a6}{FORK\_\-cb\_\-rtn} {\em handler}, void $\ast$ {\em contents})}}
\label{FORK_8h_a34}


Ques a message using the internal FORK message blocks. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em que}]The target fork que. \item[{\em handler}]A callback handler. This may be specified as NULL, in which case, the default handler established by \hyperlink{FORK_8c_a5}{FORK\_\-create()}, will handle the message. \item[{\em contents}]A single 32-bit value representing the message contents. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Status\end{Desc}
Ques a message to the FORK message que using the internal system message pool. System messages are limited to queing a single 32-bit number. Of course one can always use this to que a pointer to another data structure. The user should consider \hyperlink{FORK_8c_a19}{FORK\_\-qusr()}, to que a more complicated message without absorbing another level of indirection.

Note that because the message is internally allocated it may be possible that this list is exhausted. This version of the routine waits indefinitely until a message becomes available. See {\em \hyperlink{FORK_8c_a16}{FORK\_\-qsys()}\/} or {\em FORK\_\-qsys\-W\_\-toc\/} for no wait and wait with timeout versions.\hypertarget{FORK_8h_a35}{
\index{FORK.h@{FORK.h}!FORK_qsysW_toc@{FORK\_\-qsysW\_\-toc}}
\index{FORK_qsysW_toc@{FORK\_\-qsysW\_\-toc}!FORK.h@{FORK.h}}
\subsubsection[FORK\_\-qsysW\_\-toc]{\setlength{\rightskip}{0pt plus 5cm}int FORK\_\-qsys\-W\_\-toc (\hyperlink{union__FORK__que}{FORK\_\-que} $\ast$ {\em que}, \hyperlink{FORK_8h_a6}{FORK\_\-cb\_\-rtn} {\em handler}, void $\ast$ {\em contents}, const \hyperlink{struct__TOC}{TOC} $\ast$ {\em tmo\_\-toc})}}
\label{FORK_8h_a35}


Ques a message using the internal FORK message blocks. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em que}]The target fork que. \item[{\em handler}]A callback handler. This may be specified as NULL, in which case, the default handler established by \hyperlink{FORK_8c_a5}{FORK\_\-create()}, will handle the message. \item[{\em contents}]A single 32-bit value representing the message contents. \item[{\em tmo\_\-toc}]A timeout control structure. This is used when no system message blocks available. The values TOC\_\-NOWAIT and TOC\_\-FOREVER can be used here. The information in this structure is copied, so the user may free the memory after the call. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Status\end{Desc}
Ques a message to the FORK message que using the internal system message pool. System messages are limited to queing a single 32-bit number. Of course one can always use this to que a pointer to another data structure. The user should consider \hyperlink{FORK_8c_a19}{FORK\_\-qusr()}, to que a more complicated message without absorbing another level of indirection.

Note that because the message is internally allocated it may be possible that this list is exhausted. A timeout parameter is provided to handle this situation. See {\em \hyperlink{FORK_8c_a16}{FORK\_\-qsys()}\/} or {\em FORK\_\-qsys\-W\/} for no wait and wait forever versions.\hypertarget{FORK_8h_a31}{
\index{FORK.h@{FORK.h}!FORK_qtail_modify@{FORK\_\-qtail\_\-modify}}
\index{FORK_qtail_modify@{FORK\_\-qtail\_\-modify}!FORK.h@{FORK.h}}
\subsubsection[FORK\_\-qtail\_\-modify]{\setlength{\rightskip}{0pt plus 5cm}int FORK\_\-qtail\_\-modify (\hyperlink{union__FORK__que}{FORK\_\-que} $\ast$ {\em que}, \hyperlink{FORK_8h_a7}{FORK\_\-cb\_\-modify} {\em modify}, void $\ast$ {\em context})}}
\label{FORK_8h_a31}


Sneaky way to modify the tail (newest) element on the specified FORK que. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em que}]The target fork que. \item[{\em modify}]A callback handler used to modify the que element. The return value of this callback routine is the return value of FORK\_\-qhead\_\-modify. \end{description}
\end{Desc}
\begin{Desc}
\item[Warning:]If the que is empty, NULL is passed as the msg\_\-hdr header in the callback routine. \end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em context}]A user provided context parameter. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Whatever the user callback routine does.\end{Desc}
\hypertarget{FORK_8h_a39}{
\index{FORK.h@{FORK.h}!FORK_que_get@{FORK\_\-que\_\-get}}
\index{FORK_que_get@{FORK\_\-que\_\-get}!FORK.h@{FORK.h}}
\subsubsection[FORK\_\-que\_\-get]{\setlength{\rightskip}{0pt plus 5cm}\hyperlink{union__FORK__que}{FORK\_\-que}$\ast$ FORK\_\-que\_\-get (\hyperlink{struct__FORK__fcb}{FORK\_\-fcb} $\ast$ {\em fcb}, int {\em que\_\-id})}}
\label{FORK_8h_a39}


Returns a handle to the specified que. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em fcb}]The FORK Control Block \item[{\em que\_\-id}]The ID of the que \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]A handle to the specified que or NULL if no such que exists.\end{Desc}
The FORK que routines take a FORK que as a parameter. This is used routine is used to get that handle. When a single que is managed by the FORK routines, only a {\em que\_\-id\/} of 0 is allowed. When multiple ques are managed by the FORK routines, then an a {\em que\_\-id\/} up to nques - 1 is allowed, with que\_\-id = 0 being the highest priority que.\hypertarget{FORK_8h_a36}{
\index{FORK.h@{FORK.h}!FORK_qusr@{FORK\_\-qusr}}
\index{FORK_qusr@{FORK\_\-qusr}!FORK.h@{FORK.h}}
\subsubsection[FORK\_\-qusr]{\setlength{\rightskip}{0pt plus 5cm}int FORK\_\-qusr (\hyperlink{union__FORK__que}{FORK\_\-que} $\ast$ {\em que}, \hyperlink{FORK_8h_a6}{FORK\_\-cb\_\-rtn} {\em handler}, \hyperlink{struct__FORK__msg__hdr}{FORK\_\-msg\_\-hdr} $\ast$ {\em msg\_\-hdr})}}
\label{FORK_8h_a36}


Ques a user composed message. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em que}]The target fork que. \item[{\em handler}]A callback handler. This may be specified as NULL, in which case, the default handler established by \hyperlink{FORK_8c_a5}{FORK\_\-create()}, will handle the message. \item[{\em msg\_\-hdr}]Pointer to the message to que. It is mandatory that all queued messages are prefaced by a standard message header block \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Status\end{Desc}
Ques a user defined message. This routine behaves in much the same manner as \hyperlink{FORK_8c_a16}{FORK\_\-qsys()}, except the message being queued is controlled almost entirely by the user. (The except part, is that the message must be prefaced by a standard message header.)

For the extra work involved in using this routine, the user gets to control his own memory allocation and the exact contents of the message. This means that there is almost no case, other than an internal corruption, under which this routine can fail.\hypertarget{FORK_8h_a37}{
\index{FORK.h@{FORK.h}!FORK_resume@{FORK\_\-resume}}
\index{FORK_resume@{FORK\_\-resume}!FORK.h@{FORK.h}}
\subsubsection[FORK\_\-resume]{\setlength{\rightskip}{0pt plus 5cm}int FORK\_\-resume (\hyperlink{struct__FORK__fcb}{FORK\_\-fcb} $\ast$ {\em fcb})}}
\label{FORK_8h_a37}


Resumes a previously suspended FORK task. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em fcb}]The FORK Control Block \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Status\end{Desc}
\begin{Desc}
\item[Warning:]This routine and its companion, {\em \hyperlink{FORK_8c_a21}{FORK\_\-suspend()}\/}, are primarily intended to be used for debugging and test code purposes.\end{Desc}
\hypertarget{FORK_8h_a38}{
\index{FORK.h@{FORK.h}!FORK_suspend@{FORK\_\-suspend}}
\index{FORK_suspend@{FORK\_\-suspend}!FORK.h@{FORK.h}}
\subsubsection[FORK\_\-suspend]{\setlength{\rightskip}{0pt plus 5cm}int FORK\_\-suspend (\hyperlink{struct__FORK__fcb}{FORK\_\-fcb} $\ast$ {\em fcb})}}
\label{FORK_8h_a38}


Suspends the FORK task. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em fcb}]The FORK Control Block \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Status\end{Desc}
\begin{Desc}
\item[Warning:]This routine and its companion, {\em \hyperlink{FORK_8c_a20}{FORK\_\-resume()}\/}, are primarily intended to be used for debugging and test code purposes.\end{Desc}
