\hypertarget{hd_8c}{
\section{hd.c File Reference}
\label{hd_8c}\index{hd.c@{hd.c}}
}
{\tt \#include $<$stdio.h$>$}\par
{\tt \#include $<$stdlib.h$>$}\par
{\tt \#include $<$unistd.h$>$}\par
{\tt \#include $<$ctype.h$>$}\par
{\tt \#include $<$string.h$>$}\par
{\tt \#include $<$limits.h$>$}\par
{\tt \#include \char`\"{}TCL/tcl.h\char`\"{}}\par
{\tt \#include \char`\"{}TCL/tk.h\char`\"{}}\par
{\tt \#include \char`\"{}TCL/hd.h\char`\"{}}\par
\subsection*{Data Structures}
\begin{CompactItemize}
\item 
struct \hyperlink{struct__hd__config}{\_\-hd\_\-config}
\end{CompactItemize}
\subsection*{Typedefs}
\begin{CompactItemize}
\item 
typedef \hyperlink{struct__hd__config}{\_\-hd\_\-config} \hyperlink{hd_8c_a0}{hd\_\-config}
\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
int \hyperlink{hd_8c_a3}{Line\-Read} (Client\-Data client\-Data, Tcl\_\-Interp $\ast$interp, int argc, char $\ast$argv\mbox{[}$\,$\mbox{]})
\item 
int \hyperlink{hd_8c_a4}{File\-Rewind} (Client\-Data client\-Data, Tcl\_\-Interp $\ast$interp, int argc, char $\ast$argv\mbox{[}$\,$\mbox{]})
\item 
int \hyperlink{hd_8c_a5}{Line\-Ascii} (Client\-Data client\-Data, Tcl\_\-Interp $\ast$interp, int argc, char $\ast$argv\mbox{[}$\,$\mbox{]})
\item 
int \hyperlink{hd_8c_a6}{Tcl\_\-Hd\-Init} (Tcl\_\-Interp $\ast$interp)
\item 
int \hyperlink{hd_8c_a7}{Read\-Integer} (\hyperlink{hd_8c_a0}{hd\_\-config} $\ast$g, Tcl\_\-Interp $\ast$interp, int size, int num\-Items, char $\ast$format)
\item 
int \hyperlink{hd_8c_a8}{Read\-Float} (\hyperlink{hd_8c_a0}{hd\_\-config} $\ast$g, Tcl\_\-Interp $\ast$interp, int size, int num\-Items, char $\ast$format)
\item 
int \hyperlink{hd_8c_a9}{main} (int argc, char $\ast$$\ast$argv)
\end{CompactItemize}
\subsection*{Variables}
\begin{CompactItemize}
\item 
\hyperlink{hd_8c_a0}{hd\_\-config} \hyperlink{hd_8c_a1}{hd\-Config}
\item 
const char $\ast$ \hyperlink{hd_8c_a2}{usage\-Str}
\end{CompactItemize}


\subsection{Detailed Description}
 Function definitions for hd application.



\subsection{Typedef Documentation}
\hypertarget{hd_8c_a0}{
\index{hd.c@{hd.c}!hd_config@{hd\_\-config}}
\index{hd_config@{hd\_\-config}!hd.c@{hd.c}}
\subsubsection[hd\_\-config]{\setlength{\rightskip}{0pt plus 5cm}hd\_\-config}}
\label{hd_8c_a0}


The typedef for \hyperlink{struct__hd__config}{\_\-hd\_\-config}. 

\subsection{Function Documentation}
\hypertarget{hd_8c_a4}{
\index{hd.c@{hd.c}!FileRewind@{FileRewind}}
\index{FileRewind@{FileRewind}!hd.c@{hd.c}}
\subsubsection[FileRewind]{\setlength{\rightskip}{0pt plus 5cm}int File\-Rewind (Client\-Data {\em client\-Data}, Tcl\_\-Interp $\ast$ {\em interp}, int {\em argc}, char $\ast$ {\em argv}\mbox{[}$\,$\mbox{]})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{hd_8c_a4}


Callback for the Tcl {\em File\-Rewind} command. Rewinds the dump file.\begin{Desc}
\item[Parameters: ]\par
\begin{description}
\item[{\em 
client\-Data}]Application global config info. \item[{\em 
interp}]The Tcl interpreter handle. \item[{\em 
argc}]The number of arguments. \item[{\em 
argv}]Pointers to the argument strings.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns: ]\par
TCL\_\-OK. \end{Desc}
\hypertarget{hd_8c_a5}{
\index{hd.c@{hd.c}!LineAscii@{LineAscii}}
\index{LineAscii@{LineAscii}!hd.c@{hd.c}}
\subsubsection[LineAscii]{\setlength{\rightskip}{0pt plus 5cm}int Line\-Ascii (Client\-Data {\em client\-Data}, Tcl\_\-Interp $\ast$ {\em interp}, int {\em argc}, char $\ast$ {\em argv}\mbox{[}$\,$\mbox{]})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{hd_8c_a5}


Callback for the Tcl {\em Line\-Ascii} command. Expects: \par
  argv\mbox{[}1\mbox{]} = \# of bytes to convert \par
 The ASCII version of the binary data is linked to the Tcl interpreter result field.\begin{Desc}
\item[Parameters: ]\par
\begin{description}
\item[{\em 
client\-Data}]Application global config info. \item[{\em 
interp}]The Tcl interpreter handle. \item[{\em 
argc}]The number of arguments. \item[{\em 
argv}]Pointers to the argument strings.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns: ]\par
TCL\_\-OK. \end{Desc}
\hypertarget{hd_8c_a3}{
\index{hd.c@{hd.c}!LineRead@{LineRead}}
\index{LineRead@{LineRead}!hd.c@{hd.c}}
\subsubsection[LineRead]{\setlength{\rightskip}{0pt plus 5cm}int Line\-Read (Client\-Data {\em client\-Data}, Tcl\_\-Interp $\ast$ {\em interp}, int {\em argc}, char $\ast$ {\em argv}\mbox{[}$\,$\mbox{]})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{hd_8c_a3}


Callback for the Tcl {\em Line\-Read} command. Expects: \par
  argv\mbox{[}1\mbox{]} = \# of bytes in data \par
 argv\mbox{[}2\mbox{]} = data format \par
 argv\mbox{[}3\mbox{]} = \# of items to read \par
 The ASCII version of the binary data is linked to the Tcl interpreter result field.\begin{Desc}
\item[Parameters: ]\par
\begin{description}
\item[{\em 
client\-Data}]Application global config info. \item[{\em 
interp}]The Tcl interpreter handle. \item[{\em 
argc}]The number of arguments. \item[{\em 
argv}]Pointers to the argument strings.\end{description}
\end{Desc}
\begin{Desc}
\item[Return values: ]\par
\begin{description}
\item[{\em 
TCL\_\-OK}]Success. \item[{\em 
TCL\_\-ERROR}]Failure. \end{description}
\end{Desc}
\hypertarget{hd_8c_a9}{
\index{hd.c@{hd.c}!main@{main}}
\index{main@{main}!hd.c@{hd.c}}
\subsubsection[main]{\setlength{\rightskip}{0pt plus 5cm}int main (int {\em argc}, char $\ast$$\ast$ {\em argv})}}
\label{hd_8c_a9}


Application entry point. The program resources are intialized, then the Tcl and Tk interpreters are started using the script {\em hd.tk}\char`\"{}.\begin{Desc}
\item[Parameters: ]\par
\begin{description}
\item[{\em 
argc}]The number of command line arguments. \item[{\em 
argv}]Pointer to the command line argument strings.\end{description}
\end{Desc}
\begin{Desc}
\item[Return values: ]\par
\begin{description}
\item[{\em 
0}]Success. \item[{\em 
-1}]Failure. \end{description}
\end{Desc}
\hypertarget{hd_8c_a8}{
\index{hd.c@{hd.c}!ReadFloat@{ReadFloat}}
\index{ReadFloat@{ReadFloat}!hd.c@{hd.c}}
\subsubsection[ReadFloat]{\setlength{\rightskip}{0pt plus 5cm}int Read\-Float (\hyperlink{hd_8c_a0}{hd\_\-config} $\ast$ {\em g}, Tcl\_\-Interp $\ast$ {\em interp}, int {\em size}, int {\em num\-Items}, char $\ast$ {\em format})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{hd_8c_a8}


Reads in one or more floating point values from the input file. The data is converted to the appropriate ASCII string and appended to the Tcl interpreter result field.\begin{Desc}
\item[Parameters: ]\par
\begin{description}
\item[{\em 
g}]Application global config info. \item[{\em 
interp}]The Tcl interpreter handle. \item[{\em 
size}]The size in bytes of each item to read. \item[{\em 
num\-Items}]The number of items to read and convert. \item[{\em 
format}]The format string to apply.\end{description}
\end{Desc}
\begin{Desc}
\item[Return values: ]\par
\begin{description}
\item[{\em 
TCL\_\-OK}]Success. \item[{\em 
TCL\_\-ERROR}]Failure. \end{description}
\end{Desc}
\hypertarget{hd_8c_a7}{
\index{hd.c@{hd.c}!ReadInteger@{ReadInteger}}
\index{ReadInteger@{ReadInteger}!hd.c@{hd.c}}
\subsubsection[ReadInteger]{\setlength{\rightskip}{0pt plus 5cm}int Read\-Integer (\hyperlink{hd_8c_a0}{hd\_\-config} $\ast$ {\em g}, Tcl\_\-Interp $\ast$ {\em interp}, int {\em size}, int {\em num\-Items}, char $\ast$ {\em format})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{hd_8c_a7}


Reads in one or more integer values from the input file. The data is converted to the appropriate ASCII string and appended to the Tcl interpreter result field.\begin{Desc}
\item[Parameters: ]\par
\begin{description}
\item[{\em 
g}]Application global config info. \item[{\em 
interp}]The Tcl interpreter handle. \item[{\em 
size}]The size in bytes of each item to read. \item[{\em 
num\-Items}]The number of items to read and convert. \item[{\em 
format}]The format string to apply.\end{description}
\end{Desc}
\begin{Desc}
\item[Return values: ]\par
\begin{description}
\item[{\em 
TCL\_\-OK}]Success. \item[{\em 
TCL\_\-ERROR}]Failure. \end{description}
\end{Desc}
\hypertarget{hd_8c_a6}{
\index{hd.c@{hd.c}!Tcl_HdInit@{Tcl\_\-HdInit}}
\index{Tcl_HdInit@{Tcl\_\-HdInit}!hd.c@{hd.c}}
\subsubsection[Tcl\_\-HdInit]{\setlength{\rightskip}{0pt plus 5cm}int Tcl\_\-Hd\-Init (Tcl\_\-Interp $\ast$ {\em interp})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{hd_8c_a6}


The Tcl/Tk initialization callback. This function is called by Tcl after the interpreter is created but before the application starts. The Tcl interpreter is expanded to handle the application specific commands.\begin{Desc}
\item[Parameters: ]\par
\begin{description}
\item[{\em 
interp}]The Tcl interpreter handle.\end{description}
\end{Desc}
\begin{Desc}
\item[Return values: ]\par
\begin{description}
\item[{\em 
TCL\_\-OK}]Success. \item[{\em 
TCL\_\-ERROR}]Failure. \end{description}
\end{Desc}


\subsection{Variable Documentation}
\hypertarget{hd_8c_a1}{
\index{hd.c@{hd.c}!hdConfig@{hdConfig}}
\index{hdConfig@{hdConfig}!hd.c@{hd.c}}
\subsubsection[hdConfig]{\setlength{\rightskip}{0pt plus 5cm}hd\-Config\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{hd_8c_a1}


The application global config info. \hypertarget{hd_8c_a2}{
\index{hd.c@{hd.c}!usageStr@{usageStr}}
\index{usageStr@{usageStr}!hd.c@{hd.c}}
\subsubsection[usageStr]{\setlength{\rightskip}{0pt plus 5cm}usage\-Str\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{hd_8c_a2}


{\bf Initial value:}

\footnotesize\begin{verbatim} "hd [-b|n|x|d|X|D|f|F] file_name\n\n"
                                  "\tb - 8-bit hex\n"
                                  "\tn - 8-bit dec\n"
                                  "\tx - 16-bit hex\n"
                                  "\td - 16-bit dec\n"
                                  "\tX - 32-bit hex\n"
                                  "\tD - 32-bit dec\n"
                                  "\tf - 32-bit single float\n"
                                  "\tF - 64-bin double float"\end{verbatim}\normalsize 
The help string for the application. 