\input manualMacros.tex
\manBegin
\manPageInfo{RCI Reference Manual}{}{}
\manTitle{rciControlFxns}{3}
\manSection{NAME}
{\tt \manName{rciControlFxns}}
-- sets up RCI control functions.
\manSection{USAGE}
\cverbatim
#include <rci.h>

rciControlFxns (td, startup, control, release, arg)
   RCI_DESC *td;
   int (*startup)();
   int (*control)();
   int (*release)();
   int arg;
@endcverbatim
\manSection{ARGUMENTS}
\manItem{{\tt td} --} 
Pointer to task descriptor.
\manItem{{\tt startup} --}
Function called once at the start of every control session.
\manItem{{\tt control} --}
Function called once every control cycle.
\manItem{{\tt release} --}
Function called once at the end of every control session.
\manItem{{\tt arg} --}
Argument supplied to the control functions.
\manSection{RESTRICTIONS}
This routine must be called from the planning level.
\manSection{DESCRIPTION}
{\tt rciControlFxns()}
defines the user control functions that constitute an
RCI control task. The routine may be called only when the task is
{\it idle} (i.e., not running). Functions can be omitted by declaring the
appropriate argument to be {\tt NULLF}.

The control functions are the heart of the RCI task, and are
described further in {\tt controlFxns(7)}.

\manSection{DIAGNOSTICS}
{\tt rciControlFxns()} returns {\tt -1} when an error occurs.
Error information is reported on the {\it errorStack} (q.v.).

Returned error codes, accessible with {\tt getErrorCode()}, are:

\manItem{{\tt EDescriptor} --}
Invalid task descriptor.
\manItem{{\tt EActive} --}
Task is currently active and hence its functions can't be changed.
\manItem{{\tt ERange} --}
The address associated with a function pointer lies outside of the 
{\it control text} area (this check is not made on all systems).

The routine will abort the program if called from the control level.
\manSection{SEE ALSO}
\rightskip=0ptplus1fil
{\tt rciCreate(3)}, {\tt rciStart(3)}, {\tt errorStack(3)},
{\tt errorStack(3)}, {\tt controlFxns(7)}.

\manEnd
\end
