\hypertarget{calc_hsm_8c}{
\section{calc/calcHsm.c File Reference}
\label{calc_hsm_8c}\index{calc/calcHsm.c@{calc/calcHsm.c}}
}
{\tt \#include \char`\"{}calcHsm.h\char`\"{}}\par
{\tt \#include $<$stdlib.h$>$}\par
{\tt \#include $<$stdio.h$>$}\par
\subsection*{Functions}
\begin{CompactItemize}
\item 
\hyperlink{simplehsm_8h_5a6cc73d9d531136e91731a2b6509121}{stnext} \hyperlink{calc_hsm_8c_1b375618404998ad37faaed3327a2327}{on} (int signal, void $\ast$param)
\item 
\hyperlink{simplehsm_8h_5a6cc73d9d531136e91731a2b6509121}{stnext} \hyperlink{calc_hsm_8c_e8de54d54e6c65b0c7252aca30b8e379}{ready} (int signal, void $\ast$param)
\item 
\hyperlink{simplehsm_8h_5a6cc73d9d531136e91731a2b6509121}{stnext} \hyperlink{calc_hsm_8c_9ee1f0f5f4243f4680181b46e8ae54d2}{result} (int signal, void $\ast$param)
\item 
\hyperlink{simplehsm_8h_5a6cc73d9d531136e91731a2b6509121}{stnext} \hyperlink{calc_hsm_8c_e7eecbf88bdc3a84f7c4df8cd4d9bdf7}{begin} (int signal, void $\ast$param)
\item 
\hyperlink{simplehsm_8h_5a6cc73d9d531136e91731a2b6509121}{stnext} \hyperlink{calc_hsm_8c_bdcc999b707ffe89974b5d0b5eb543f2}{negated1} (int signal, void $\ast$param)
\item 
\hyperlink{simplehsm_8h_5a6cc73d9d531136e91731a2b6509121}{stnext} \hyperlink{calc_hsm_8c_306e690b940db8d21e68d7862da4a008}{operand1} (int signal, void $\ast$param)
\item 
\hyperlink{simplehsm_8h_5a6cc73d9d531136e91731a2b6509121}{stnext} \hyperlink{calc_hsm_8c_7a9af7186c942c55453b82c9d8ea5172}{zero1} (int signal, void $\ast$param)
\item 
\hyperlink{simplehsm_8h_5a6cc73d9d531136e91731a2b6509121}{stnext} \hyperlink{calc_hsm_8c_b9898b2197bbea0161caeae5546f6f67}{int1} (int signal, void $\ast$param)
\item 
\hyperlink{simplehsm_8h_5a6cc73d9d531136e91731a2b6509121}{stnext} \hyperlink{calc_hsm_8c_d100f3800ac4ca550a67d932e4e44e0e}{frac1} (int signal, void $\ast$param)
\item 
\hyperlink{simplehsm_8h_5a6cc73d9d531136e91731a2b6509121}{stnext} \hyperlink{calc_hsm_8c_3275a954b9411f213ea1b8dc823aa775}{error} (int signal, void $\ast$param)
\item 
\hyperlink{simplehsm_8h_5a6cc73d9d531136e91731a2b6509121}{stnext} \hyperlink{calc_hsm_8c_5a884d7ae7fb47f2aed70e4b39b52673}{opEntered} (int signal, void $\ast$param)
\item 
\hyperlink{simplehsm_8h_5a6cc73d9d531136e91731a2b6509121}{stnext} \hyperlink{calc_hsm_8c_3779c9672f4257e7b0c506fd2fbcbfc7}{negated2} (int signal, void $\ast$param)
\item 
\hyperlink{simplehsm_8h_5a6cc73d9d531136e91731a2b6509121}{stnext} \hyperlink{calc_hsm_8c_9a4754b62a93abeb215aeefb13ca7e2e}{operand2} (int signal, void $\ast$param)
\item 
\hyperlink{simplehsm_8h_5a6cc73d9d531136e91731a2b6509121}{stnext} \hyperlink{calc_hsm_8c_d7fa4046ebd8fa1ef09e769060af4d2c}{zero2} (int signal, void $\ast$param)
\item 
\hyperlink{simplehsm_8h_5a6cc73d9d531136e91731a2b6509121}{stnext} \hyperlink{calc_hsm_8c_ecf5b311a7ac25179fdc33e9d0b48a97}{int2} (int signal, void $\ast$param)
\item 
\hyperlink{simplehsm_8h_5a6cc73d9d531136e91731a2b6509121}{stnext} \hyperlink{calc_hsm_8c_d1d2745a5e2ccd7d1a569d5b907e3eaf}{frac2} (int signal, void $\ast$param)
\item 
void \hyperlink{calc_hsm_8c_85c95952b3efd8972f87cf0e29a3dbb7}{calchsm\_\-init} (Ihandle $\ast$tb)
\item 
void \hyperlink{calc_hsm_8c_d07dc08edc5dfd4eb925381bc6f870f4}{calchsm\_\-signal} (int signal, void $\ast$param)
\item 
void \hyperlink{calc_hsm_8c_06ed5713dc14dbeb741b1fec3c81afe8}{zero} (void)
\item 
void \hyperlink{calc_hsm_8c_1df08cf4cac3a6ad3da2574b4d1e432d}{negate} (void)
\item 
void \hyperlink{calc_hsm_8c_8199cdb3536b433bfe5639b1917e9be7}{append} (char c)
\item 
double \hyperlink{calc_hsm_8c_ae5b3ed2c107399b7eccfa62a2b40e4e}{calc} (double operand1, double operand2, char operator\_\-)
\end{CompactItemize}
\subsection*{Variables}
\begin{CompactItemize}
\item 
\hyperlink{structsimplehsm__t}{simplehsm\_\-t} \hyperlink{calc_hsm_8c_b0f5f1813e601676237fefa2690bf4a5}{hsm} = \{NULL\}
\item 
Ihandle $\ast$ \hyperlink{calc_hsm_8c_48f47fd6c5b0709edd7a1c18941da5af}{textbox} = NULL
\item 
BOOL \hyperlink{calc_hsm_8c_8ec22c7f9158ea5dadf1f679037bf0fe}{clear\_\-on\_\-next}
\item 
BOOL \hyperlink{calc_hsm_8c_0e011d913b7fc564e58af53e0c7bf812}{negative}
\item 
double \hyperlink{calc_hsm_8c_a99d7a4a4e337e0aa8e696b2c15fdb24}{\_\-operand1}
\item 
char \hyperlink{calc_hsm_8c_f24de0c11acedc01bfe6e3d883dfe121}{\_\-operator}
\end{CompactItemize}


\label{_details}
\hypertarget{_details}{}
\subsection{Detailed Description}
\begin{Desc}
\item[Author:]Daniel Newton $<$\href{mailto:djpnewton@gmail.com}{\tt djpnewton@gmail.com}$>$ \end{Desc}
\begin{Desc}
\item[Version:]1.0\end{Desc}
\hypertarget{simplehsm_8h_LICENSE}{}\subsection{LICENSE}\label{simplehsm_8h_LICENSE}
Copyright (c) 2009 Daniel Newton

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \char`\"{}Software\char`\"{}), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED \char`\"{}AS IS\char`\"{}, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\hypertarget{simplehsm_8h_DESCRIPTION}{}\subsection{DESCRIPTION}\label{simplehsm_8h_DESCRIPTION}
The calc state machine 

\subsection{Function Documentation}
\hypertarget{calc_hsm_8c_8199cdb3536b433bfe5639b1917e9be7}{
\index{calcHsm.c@{calcHsm.c}!append@{append}}
\index{append@{append}!calcHsm.c@{calcHsm.c}}
\subsubsection[{append}]{\setlength{\rightskip}{0pt plus 5cm}void append (char {\em c})}}
\label{calc_hsm_8c_8199cdb3536b433bfe5639b1917e9be7}


Append a character to the textbox input, if the \hyperlink{calc_hsm_8c_8ec22c7f9158ea5dadf1f679037bf0fe}{clear\_\-on\_\-next} variable is set then clear the textbox first

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em c}]The character to insert \end{description}
\end{Desc}
\hypertarget{calc_hsm_8c_e7eecbf88bdc3a84f7c4df8cd4d9bdf7}{
\index{calcHsm.c@{calcHsm.c}!begin@{begin}}
\index{begin@{begin}!calcHsm.c@{calcHsm.c}}
\subsubsection[{begin}]{\setlength{\rightskip}{0pt plus 5cm}{\bf stnext} begin (int {\em signal}, \/  void $\ast$ {\em param})}}
\label{calc_hsm_8c_e7eecbf88bdc3a84f7c4df8cd4d9bdf7}


The 'begin' state functon

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em signal}]The signal to handle \item[{\em param}]The accompaning parameter \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]NULL if the signal is handled otherwise \hyperlink{calc_hsm_8c_e8de54d54e6c65b0c7252aca30b8e379}{ready()} (the parent state) \end{Desc}
\hypertarget{calc_hsm_8c_ae5b3ed2c107399b7eccfa62a2b40e4e}{
\index{calcHsm.c@{calcHsm.c}!calc@{calc}}
\index{calc@{calc}!calcHsm.c@{calcHsm.c}}
\subsubsection[{calc}]{\setlength{\rightskip}{0pt plus 5cm}double calc (double {\em operand1}, \/  double {\em operand2}, \/  char {\em operator\_\-})}}
\label{calc_hsm_8c_ae5b3ed2c107399b7eccfa62a2b40e4e}


Calculate the result of a function

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em operand1}]The first operand \item[{\em operand2}]The second operand \item[{\em operator\_\-}]The operator (+, -, $\ast$, /) to use \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]The result of the function \end{Desc}
\hypertarget{calc_hsm_8c_85c95952b3efd8972f87cf0e29a3dbb7}{
\index{calcHsm.c@{calcHsm.c}!calchsm\_\-init@{calchsm\_\-init}}
\index{calchsm\_\-init@{calchsm\_\-init}!calcHsm.c@{calcHsm.c}}
\subsubsection[{calchsm\_\-init}]{\setlength{\rightskip}{0pt plus 5cm}void calchsm\_\-init (Ihandle $\ast$ {\em tb})}}
\label{calc_hsm_8c_85c95952b3efd8972f87cf0e29a3dbb7}


Initialize the calc state machine

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em tb}]The IUP textbox widget that the calc state machine will use \end{description}
\end{Desc}
\hypertarget{calc_hsm_8c_d07dc08edc5dfd4eb925381bc6f870f4}{
\index{calcHsm.c@{calcHsm.c}!calchsm\_\-signal@{calchsm\_\-signal}}
\index{calchsm\_\-signal@{calchsm\_\-signal}!calcHsm.c@{calcHsm.c}}
\subsubsection[{calchsm\_\-signal}]{\setlength{\rightskip}{0pt plus 5cm}void calchsm\_\-signal (int {\em signal}, \/  void $\ast$ {\em param})}}
\label{calc_hsm_8c_d07dc08edc5dfd4eb925381bc6f870f4}


Send a signal to the calc state machine

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em signal}]The signal to send \item[{\em param}]An optional parameter \end{description}
\end{Desc}
\hypertarget{calc_hsm_8c_3275a954b9411f213ea1b8dc823aa775}{
\index{calcHsm.c@{calcHsm.c}!error@{error}}
\index{error@{error}!calcHsm.c@{calcHsm.c}}
\subsubsection[{error}]{\setlength{\rightskip}{0pt plus 5cm}{\bf stnext} error (int {\em signal}, \/  void $\ast$ {\em param})}}
\label{calc_hsm_8c_3275a954b9411f213ea1b8dc823aa775}


The 'error' state functon

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em signal}]The signal to handle \item[{\em param}]The accompaning parameter \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]\hyperlink{calc_hsm_8c_1b375618404998ad37faaed3327a2327}{on()} (the parent state) \end{Desc}
\hypertarget{calc_hsm_8c_d100f3800ac4ca550a67d932e4e44e0e}{
\index{calcHsm.c@{calcHsm.c}!frac1@{frac1}}
\index{frac1@{frac1}!calcHsm.c@{calcHsm.c}}
\subsubsection[{frac1}]{\setlength{\rightskip}{0pt plus 5cm}{\bf stnext} frac1 (int {\em signal}, \/  void $\ast$ {\em param})}}
\label{calc_hsm_8c_d100f3800ac4ca550a67d932e4e44e0e}


The 'frac1' state functon

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em signal}]The signal to handle \item[{\em param}]The accompaning parameter \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]NULL if the signal is handled otherwise \hyperlink{calc_hsm_8c_306e690b940db8d21e68d7862da4a008}{operand1()} (the parent state) \end{Desc}
\hypertarget{calc_hsm_8c_d1d2745a5e2ccd7d1a569d5b907e3eaf}{
\index{calcHsm.c@{calcHsm.c}!frac2@{frac2}}
\index{frac2@{frac2}!calcHsm.c@{calcHsm.c}}
\subsubsection[{frac2}]{\setlength{\rightskip}{0pt plus 5cm}{\bf stnext} frac2 (int {\em signal}, \/  void $\ast$ {\em param})}}
\label{calc_hsm_8c_d1d2745a5e2ccd7d1a569d5b907e3eaf}


The 'frac2' state functon

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em signal}]The signal to handle \item[{\em param}]The accompaning parameter \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]NULL if the signal is handled otherwise \hyperlink{calc_hsm_8c_9a4754b62a93abeb215aeefb13ca7e2e}{operand2()} (the parent state) \end{Desc}
\hypertarget{calc_hsm_8c_b9898b2197bbea0161caeae5546f6f67}{
\index{calcHsm.c@{calcHsm.c}!int1@{int1}}
\index{int1@{int1}!calcHsm.c@{calcHsm.c}}
\subsubsection[{int1}]{\setlength{\rightskip}{0pt plus 5cm}{\bf stnext} int1 (int {\em signal}, \/  void $\ast$ {\em param})}}
\label{calc_hsm_8c_b9898b2197bbea0161caeae5546f6f67}


The 'int1' state functon

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em signal}]The signal to handle \item[{\em param}]The accompaning parameter \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]NULL if the signal is handled otherwise \hyperlink{calc_hsm_8c_306e690b940db8d21e68d7862da4a008}{operand1()} (the parent state) \end{Desc}
\hypertarget{calc_hsm_8c_ecf5b311a7ac25179fdc33e9d0b48a97}{
\index{calcHsm.c@{calcHsm.c}!int2@{int2}}
\index{int2@{int2}!calcHsm.c@{calcHsm.c}}
\subsubsection[{int2}]{\setlength{\rightskip}{0pt plus 5cm}{\bf stnext} int2 (int {\em signal}, \/  void $\ast$ {\em param})}}
\label{calc_hsm_8c_ecf5b311a7ac25179fdc33e9d0b48a97}


The 'int2' state functon

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em signal}]The signal to handle \item[{\em param}]The accompaning parameter \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]NULL if the signal is handled otherwise \hyperlink{calc_hsm_8c_9a4754b62a93abeb215aeefb13ca7e2e}{operand2()} (the parent state) \end{Desc}
\hypertarget{calc_hsm_8c_1df08cf4cac3a6ad3da2574b4d1e432d}{
\index{calcHsm.c@{calcHsm.c}!negate@{negate}}
\index{negate@{negate}!calcHsm.c@{calcHsm.c}}
\subsubsection[{negate}]{\setlength{\rightskip}{0pt plus 5cm}void negate (void)}}
\label{calc_hsm_8c_1df08cf4cac3a6ad3da2574b4d1e432d}


Clear the textbox input and replace with a '-0' string also set the \hyperlink{calc_hsm_8c_0e011d913b7fc564e58af53e0c7bf812}{negative} variable \hypertarget{calc_hsm_8c_bdcc999b707ffe89974b5d0b5eb543f2}{
\index{calcHsm.c@{calcHsm.c}!negated1@{negated1}}
\index{negated1@{negated1}!calcHsm.c@{calcHsm.c}}
\subsubsection[{negated1}]{\setlength{\rightskip}{0pt plus 5cm}{\bf stnext} negated1 (int {\em signal}, \/  void $\ast$ {\em param})}}
\label{calc_hsm_8c_bdcc999b707ffe89974b5d0b5eb543f2}


The 'negated1' state functon

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em signal}]The signal to handle \item[{\em param}]The accompaning parameter \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]NULL if the signal is handled otherwise \hyperlink{calc_hsm_8c_1b375618404998ad37faaed3327a2327}{on()} (the parent state) \end{Desc}
\hypertarget{calc_hsm_8c_3779c9672f4257e7b0c506fd2fbcbfc7}{
\index{calcHsm.c@{calcHsm.c}!negated2@{negated2}}
\index{negated2@{negated2}!calcHsm.c@{calcHsm.c}}
\subsubsection[{negated2}]{\setlength{\rightskip}{0pt plus 5cm}{\bf stnext} negated2 (int {\em signal}, \/  void $\ast$ {\em param})}}
\label{calc_hsm_8c_3779c9672f4257e7b0c506fd2fbcbfc7}


The 'negated2' state functon

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em signal}]The signal to handle \item[{\em param}]The accompaning parameter \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]NULL if the signal is handled otherwise \hyperlink{calc_hsm_8c_1b375618404998ad37faaed3327a2327}{on()} (the parent state) \end{Desc}
\hypertarget{calc_hsm_8c_1b375618404998ad37faaed3327a2327}{
\index{calcHsm.c@{calcHsm.c}!on@{on}}
\index{on@{on}!calcHsm.c@{calcHsm.c}}
\subsubsection[{on}]{\setlength{\rightskip}{0pt plus 5cm}{\bf stnext} on (int {\em signal}, \/  void $\ast$ {\em param})}}
\label{calc_hsm_8c_1b375618404998ad37faaed3327a2327}


The 'on' state functon

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em signal}]The signal to handle \item[{\em param}]The accompaning parameter \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Always NULL as this is the top level state function \end{Desc}
\hypertarget{calc_hsm_8c_5a884d7ae7fb47f2aed70e4b39b52673}{
\index{calcHsm.c@{calcHsm.c}!opEntered@{opEntered}}
\index{opEntered@{opEntered}!calcHsm.c@{calcHsm.c}}
\subsubsection[{opEntered}]{\setlength{\rightskip}{0pt plus 5cm}{\bf stnext} opEntered (int {\em signal}, \/  void $\ast$ {\em param})}}
\label{calc_hsm_8c_5a884d7ae7fb47f2aed70e4b39b52673}


The 'opEntered' state functon

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em signal}]The signal to handle \item[{\em param}]The accompaning parameter \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]NULL if the signal is handled otherwise \hyperlink{calc_hsm_8c_1b375618404998ad37faaed3327a2327}{on()} (the parent state) \end{Desc}
\hypertarget{calc_hsm_8c_306e690b940db8d21e68d7862da4a008}{
\index{calcHsm.c@{calcHsm.c}!operand1@{operand1}}
\index{operand1@{operand1}!calcHsm.c@{calcHsm.c}}
\subsubsection[{operand1}]{\setlength{\rightskip}{0pt plus 5cm}{\bf stnext} operand1 (int {\em signal}, \/  void $\ast$ {\em param})}}
\label{calc_hsm_8c_306e690b940db8d21e68d7862da4a008}


The 'operand1' state functon

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em signal}]The signal to handle \item[{\em param}]The accompaning parameter \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]NULL if the signal is handled otherwise \hyperlink{calc_hsm_8c_1b375618404998ad37faaed3327a2327}{on()} (the parent state) \end{Desc}
\hypertarget{calc_hsm_8c_9a4754b62a93abeb215aeefb13ca7e2e}{
\index{calcHsm.c@{calcHsm.c}!operand2@{operand2}}
\index{operand2@{operand2}!calcHsm.c@{calcHsm.c}}
\subsubsection[{operand2}]{\setlength{\rightskip}{0pt plus 5cm}{\bf stnext} operand2 (int {\em signal}, \/  void $\ast$ {\em param})}}
\label{calc_hsm_8c_9a4754b62a93abeb215aeefb13ca7e2e}


The 'operand2' state functon

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em signal}]The signal to handle \item[{\em param}]The accompaning parameter \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]NULL if the signal is handled otherwise \hyperlink{calc_hsm_8c_1b375618404998ad37faaed3327a2327}{on()} (the parent state) \end{Desc}


\begin{Desc}
\item[\hyperlink{todo__todo000001}{Todo}]handle error like so: \end{Desc}


\begin{Code}\begin{verbatim} IupSetAttribute(textbox, "VALUE", "ERROR");
 simplehsm_transition_state(&hsm, error);
\end{verbatim}
\end{Code}



\begin{Desc}
\item[\hyperlink{todo__todo000001}{Todo}]handle error like so: \end{Desc}


\begin{Code}\begin{verbatim} IupSetAttribute(textbox, "VALUE", "ERROR");
 simplehsm_transition_state(&hsm, error);
\end{verbatim}
\end{Code}

\hypertarget{calc_hsm_8c_e8de54d54e6c65b0c7252aca30b8e379}{
\index{calcHsm.c@{calcHsm.c}!ready@{ready}}
\index{ready@{ready}!calcHsm.c@{calcHsm.c}}
\subsubsection[{ready}]{\setlength{\rightskip}{0pt plus 5cm}{\bf stnext} ready (int {\em signal}, \/  void $\ast$ {\em param})}}
\label{calc_hsm_8c_e8de54d54e6c65b0c7252aca30b8e379}


The 'ready' state functon

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em signal}]The signal to handle \item[{\em param}]The accompaning parameter \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]NULL if the signal is handled otherwise \hyperlink{calc_hsm_8c_1b375618404998ad37faaed3327a2327}{on()} (the parent state) \end{Desc}
\hypertarget{calc_hsm_8c_9ee1f0f5f4243f4680181b46e8ae54d2}{
\index{calcHsm.c@{calcHsm.c}!result@{result}}
\index{result@{result}!calcHsm.c@{calcHsm.c}}
\subsubsection[{result}]{\setlength{\rightskip}{0pt plus 5cm}{\bf stnext} result (int {\em signal}, \/  void $\ast$ {\em param})}}
\label{calc_hsm_8c_9ee1f0f5f4243f4680181b46e8ae54d2}


The 'result' state functon

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em signal}]The signal to handle \item[{\em param}]The accompaning parameter \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]\hyperlink{calc_hsm_8c_e8de54d54e6c65b0c7252aca30b8e379}{ready()} (the parent state) \end{Desc}
\hypertarget{calc_hsm_8c_06ed5713dc14dbeb741b1fec3c81afe8}{
\index{calcHsm.c@{calcHsm.c}!zero@{zero}}
\index{zero@{zero}!calcHsm.c@{calcHsm.c}}
\subsubsection[{zero}]{\setlength{\rightskip}{0pt plus 5cm}void zero (void)}}
\label{calc_hsm_8c_06ed5713dc14dbeb741b1fec3c81afe8}


Clear the textbox input and replace with a '0' string also reset the \hyperlink{calc_hsm_8c_0e011d913b7fc564e58af53e0c7bf812}{negative} variable \hypertarget{calc_hsm_8c_7a9af7186c942c55453b82c9d8ea5172}{
\index{calcHsm.c@{calcHsm.c}!zero1@{zero1}}
\index{zero1@{zero1}!calcHsm.c@{calcHsm.c}}
\subsubsection[{zero1}]{\setlength{\rightskip}{0pt plus 5cm}{\bf stnext} zero1 (int {\em signal}, \/  void $\ast$ {\em param})}}
\label{calc_hsm_8c_7a9af7186c942c55453b82c9d8ea5172}


The 'zero1' state functon

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em signal}]The signal to handle \item[{\em param}]The accompaning parameter \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]NULL if the signal is handled otherwise \hyperlink{calc_hsm_8c_306e690b940db8d21e68d7862da4a008}{operand1()} (the parent state) \end{Desc}
\hypertarget{calc_hsm_8c_d7fa4046ebd8fa1ef09e769060af4d2c}{
\index{calcHsm.c@{calcHsm.c}!zero2@{zero2}}
\index{zero2@{zero2}!calcHsm.c@{calcHsm.c}}
\subsubsection[{zero2}]{\setlength{\rightskip}{0pt plus 5cm}{\bf stnext} zero2 (int {\em signal}, \/  void $\ast$ {\em param})}}
\label{calc_hsm_8c_d7fa4046ebd8fa1ef09e769060af4d2c}


The 'zero2' state functon

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em signal}]The signal to handle \item[{\em param}]The accompaning parameter \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]NULL if the signal is handled otherwise \hyperlink{calc_hsm_8c_9a4754b62a93abeb215aeefb13ca7e2e}{operand2()} (the parent state) \end{Desc}


\subsection{Variable Documentation}
\hypertarget{calc_hsm_8c_a99d7a4a4e337e0aa8e696b2c15fdb24}{
\index{calcHsm.c@{calcHsm.c}!\_\-operand1@{\_\-operand1}}
\index{\_\-operand1@{\_\-operand1}!calcHsm.c@{calcHsm.c}}
\subsubsection[{\_\-operand1}]{\setlength{\rightskip}{0pt plus 5cm}double {\bf \_\-operand1}}}
\label{calc_hsm_8c_a99d7a4a4e337e0aa8e696b2c15fdb24}


The first operand \hypertarget{calc_hsm_8c_f24de0c11acedc01bfe6e3d883dfe121}{
\index{calcHsm.c@{calcHsm.c}!\_\-operator@{\_\-operator}}
\index{\_\-operator@{\_\-operator}!calcHsm.c@{calcHsm.c}}
\subsubsection[{\_\-operator}]{\setlength{\rightskip}{0pt plus 5cm}char {\bf \_\-operator}}}
\label{calc_hsm_8c_f24de0c11acedc01bfe6e3d883dfe121}


The current operator \hypertarget{calc_hsm_8c_8ec22c7f9158ea5dadf1f679037bf0fe}{
\index{calcHsm.c@{calcHsm.c}!clear\_\-on\_\-next@{clear\_\-on\_\-next}}
\index{clear\_\-on\_\-next@{clear\_\-on\_\-next}!calcHsm.c@{calcHsm.c}}
\subsubsection[{clear\_\-on\_\-next}]{\setlength{\rightskip}{0pt plus 5cm}BOOL {\bf clear\_\-on\_\-next}}}
\label{calc_hsm_8c_8ec22c7f9158ea5dadf1f679037bf0fe}


If this flag is set we clear the textbox and replace text with new character on the next signal \hypertarget{calc_hsm_8c_b0f5f1813e601676237fefa2690bf4a5}{
\index{calcHsm.c@{calcHsm.c}!hsm@{hsm}}
\index{hsm@{hsm}!calcHsm.c@{calcHsm.c}}
\subsubsection[{hsm}]{\setlength{\rightskip}{0pt plus 5cm}{\bf simplehsm\_\-t} {\bf hsm} = \{NULL\}}}
\label{calc_hsm_8c_b0f5f1813e601676237fefa2690bf4a5}


The Calc state machine object \hypertarget{calc_hsm_8c_0e011d913b7fc564e58af53e0c7bf812}{
\index{calcHsm.c@{calcHsm.c}!negative@{negative}}
\index{negative@{negative}!calcHsm.c@{calcHsm.c}}
\subsubsection[{negative}]{\setlength{\rightskip}{0pt plus 5cm}BOOL {\bf negative}}}
\label{calc_hsm_8c_0e011d913b7fc564e58af53e0c7bf812}


If this flag is set the current operand will be negative \hypertarget{calc_hsm_8c_48f47fd6c5b0709edd7a1c18941da5af}{
\index{calcHsm.c@{calcHsm.c}!textbox@{textbox}}
\index{textbox@{textbox}!calcHsm.c@{calcHsm.c}}
\subsubsection[{textbox}]{\setlength{\rightskip}{0pt plus 5cm}Ihandle$\ast$ {\bf textbox} = NULL}}
\label{calc_hsm_8c_48f47fd6c5b0709edd7a1c18941da5af}


The IUP textbox widget 