\hypertarget{TASK_8c}{
\section{TASK.c File Reference}
\label{TASK_8c}\index{TASK.c@{TASK.c}}
}
TASK, platform independent implementation.  


{\tt \#include $<$stdio.h$>$}\par
{\tt \#include $<$string.h$>$}\par
{\tt \#include \char`\"{}PBS/TASK.h\char`\"{}}\par
{\tt \#include \char`\"{}TASK\_\-pvtdefs.h\char`\"{}}\par
{\tt \#include \char`\"{}PBS/TBD.h\char`\"{}}\par
{\tt \#include \char`\"{}TBD\_\-pvtdefs.h\char`\"{}}\par
{\tt \#include \char`\"{}PBS/TOV.h\char`\"{}}\par
{\tt \#include \char`\"{}PBS/TOC.h\char`\"{}}\par
{\tt \#include \char`\"{}PBS/MBA.h\char`\"{}}\par


Include dependency graph for TASK.c:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=359pt]{TASK_8c__incl}
\end{center}
\end{figure}
\subsection*{Functions}
\begin{CompactItemize}
\item 
int \hyperlink{TASK_8c_a0}{TASK\_\-priority\_\-number\_\-compute} (int priority, \hyperlink{TASK_8h_a3}{TASK\_\-priority\_\-type} type, const \hyperlink{struct__TASK__tcb}{TASK\_\-tcb} $\ast$tcb)
\begin{CompactList}\small\item\em Computes a priority number, either as an absolute or based on the priority of another task. \item\end{CompactList}\item 
int \hyperlink{TASK_8c_a1}{TASK\_\-attr\_\-init} (\hyperlink{struct__TASK__attr}{TASK\_\-attr} $\ast$attributes)
\begin{CompactList}\small\item\em Provides a standard method of initializing the attributes block to a set of known values. These values may be platform dependent. \item\end{CompactList}\item 
int \hyperlink{TASK_8c_a2}{TASK\_\-attr\_\-priority\_\-set} (\hyperlink{struct__TASK__attr}{TASK\_\-attr} $\ast$attributes, int priority)
\begin{CompactList}\small\item\em Sets the priority field in the task attributes block to the the specified value. This can be either absolute or relative to the current task's priority. \item\end{CompactList}\item 
\hyperlink{struct__TASK__tcb}{TASK\_\-tcb} $\ast$ \hyperlink{TASK_8c_a3}{TASK\_\-cvt} (void)
\begin{CompactList}\small\item\em Converts an existing VXWORKs task or POSIX thread to TASK object. \item\end{CompactList}\item 
int \hyperlink{TASK_8c_a4}{TASK\_\-pause} (unsigned int nsecs)
\begin{CompactList}\small\item\em Causes the calling task to wait (pause) for the specified number of nanoseconds. \item\end{CompactList}\item 
int \hyperlink{TASK_8c_a5}{TASK\_\-rvt} (void)
\begin{CompactList}\small\item\em Reverts the current task back to its native self by stripping it of its TASK functionality. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
TASK, platform independent implementation. 

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


\footnotesize\begin{verbatim}

    CVS $Id: TASK.c,v 1.6 2004/07/27 23:55:35 russell Exp $
\end{verbatim}\normalsize


Just a place to gather the different implementations together. The real code is in the TASK.c.xx-xxx-xxx's.

\subsection{Function Documentation}
\hypertarget{TASK_8c_a1}{
\index{TASK.c@{TASK.c}!TASK_attr_init@{TASK\_\-attr\_\-init}}
\index{TASK_attr_init@{TASK\_\-attr\_\-init}!TASK.c@{TASK.c}}
\subsubsection[TASK\_\-attr\_\-init]{\setlength{\rightskip}{0pt plus 5cm}int TASK\_\-attr\_\-init (\hyperlink{struct__TASK__attr}{TASK\_\-attr} $\ast$ {\em attributes})}}
\label{TASK_8c_a1}


Provides a standard method of initializing the attributes block to a set of known values. These values may be platform dependent. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em attributes}]The attributes block to initialize \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Status. \end{Desc}
\hypertarget{TASK_8c_a2}{
\index{TASK.c@{TASK.c}!TASK_attr_priority_set@{TASK\_\-attr\_\-priority\_\-set}}
\index{TASK_attr_priority_set@{TASK\_\-attr\_\-priority\_\-set}!TASK.c@{TASK.c}}
\subsubsection[TASK\_\-attr\_\-priority\_\-set]{\setlength{\rightskip}{0pt plus 5cm}int TASK\_\-attr\_\-priority\_\-set (\hyperlink{struct__TASK__attr}{TASK\_\-attr} $\ast$ {\em attributes}, int {\em priority})}}
\label{TASK_8c_a2}


Sets the priority field in the task attributes block to the the specified value. This can be either absolute or relative to the current task's priority. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em attributes}]The target attributes block \item[{\em priority}]A signed integer indicating the absolute or relative priority. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]The assigned priority level.\end{Desc}
Absolute priorities numbers are always expressed in terms of the native system. 

Here is the call graph for this function:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=194pt]{TASK_8c_a2_cgraph}
\end{center}
\end{figure}
\hypertarget{TASK_8c_a3}{
\index{TASK.c@{TASK.c}!TASK_cvt@{TASK\_\-cvt}}
\index{TASK_cvt@{TASK\_\-cvt}!TASK.c@{TASK.c}}
\subsubsection[TASK\_\-cvt]{\setlength{\rightskip}{0pt plus 5cm}\hyperlink{struct__TASK__tcb}{TASK\_\-tcb}$\ast$ TASK\_\-cvt (void)}}
\label{TASK_8c_a3}


Converts an existing VXWORKs task or POSIX thread to TASK object. 

\begin{Desc}
\item[Returns:]The TASK's control block\end{Desc}
\begin{Desc}
\item[Warning:]This is made for quick and dirty shell and test programming. It should {\bf never} be used in production code. Use \end{Desc}
\begin{Desc}
\item[See also:]\hyperlink{TASK_8c_8px-xxx-xxx_a7}{TASK\_\-convert} () and 

\hyperlink{TASK_8c_8px-xxx-xxx_a8}{TASK\_\-revert} (). \end{Desc}


Here is the call graph for this function:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=200pt]{TASK_8c_a3_cgraph}
\end{center}
\end{figure}
\hypertarget{TASK_8c_a4}{
\index{TASK.c@{TASK.c}!TASK_pause@{TASK\_\-pause}}
\index{TASK_pause@{TASK\_\-pause}!TASK.c@{TASK.c}}
\subsubsection[TASK\_\-pause]{\setlength{\rightskip}{0pt plus 5cm}int TASK\_\-pause (unsigned int {\em nsecs})}}
\label{TASK_8c_a4}


Causes the calling task to wait (pause) for the specified number of nanoseconds. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em nsecs}]The number of nanoseconds to pause. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Status\end{Desc}
\begin{Desc}
\item[Warning:]This call should only be used for debugging purposes. The range of the pause is approximately 0 to 4 seconds. \end{Desc}


Here is the call graph for this function:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=283pt]{TASK_8c_a4_cgraph}
\end{center}
\end{figure}
\hypertarget{TASK_8c_a0}{
\index{TASK.c@{TASK.c}!TASK_priority_number_compute@{TASK\_\-priority\_\-number\_\-compute}}
\index{TASK_priority_number_compute@{TASK\_\-priority\_\-number\_\-compute}!TASK.c@{TASK.c}}
\subsubsection[TASK\_\-priority\_\-number\_\-compute]{\setlength{\rightskip}{0pt plus 5cm}int TASK\_\-priority\_\-number\_\-compute (int {\em priority}, \hyperlink{TASK_8h_a3}{TASK\_\-priority\_\-type} {\em type}, const \hyperlink{struct__TASK__tcb}{TASK\_\-tcb} $\ast$ {\em tcb})}}
\label{TASK_8c_a0}


Computes a priority number, either as an absolute or based on the priority of another task. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em priority}]If the type is specified as an absolute priority number, then this number is used as is. If the type is relative, then it is a signed number. Positive numbers are interpretted as raising the priority level (even though the value of the priority number itself may be decremented) whereas negative numbers are interpreted as lowering the priority level (even though the value of the priority number itself may be incremented.)\item[{\em type}]The type or manner in which to set the priority. This can be either relative or absolulte.\item[{\em tcb}]The task control block of a reference task. This is used iff type == TASK\_\-K\_\-PRIORITY\_\-TYPE\_\-REL. If specified as NULL, then the priority of the calling task is used.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]The priority number expressed in the native tasking model's scheme.\end{Desc}
Simple utility routine to compute a priority potentially based on another task. The priority level is returned expressed in the native tasking model's scheme. If the type is an absolute priority, the priority number returned is potentially changed to keep it within bounds. 

Here is the call graph for this function:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=324pt]{TASK_8c_a0_cgraph}
\end{center}
\end{figure}
\hypertarget{TASK_8c_a5}{
\index{TASK.c@{TASK.c}!TASK_rvt@{TASK\_\-rvt}}
\index{TASK_rvt@{TASK\_\-rvt}!TASK.c@{TASK.c}}
\subsubsection[TASK\_\-rvt]{\setlength{\rightskip}{0pt plus 5cm}int TASK\_\-rvt (void)}}
\label{TASK_8c_a5}


Reverts the current task back to its native self by stripping it of its TASK functionality. 

\begin{Desc}
\item[Warning:]This is made for quick and dirty shell and test programming. It should {\bf never} be used in production code. Use \end{Desc}
\begin{Desc}
\item[See also:]\hyperlink{TASK_8c_8px-xxx-xxx_a7}{TASK\_\-convert} () and 

\hyperlink{TASK_8c_8px-xxx-xxx_a8}{TASK\_\-revert} (). This function should be used with its partner, 

\hyperlink{TASK_8h_a20}{TASK\_\-cvt()}. \end{Desc}


Here is the call graph for this function:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=166pt]{TASK_8c_a5_cgraph}
\end{center}
\end{figure}
