\section{util/firmdl/srec.c File Reference}
\label{firmdl_2srec_8c}\index{util/firmdl/srec.c@{util/firmdl/srec.c}}
{\tt \#include $<$stdio.h$>$}\par
{\tt \#include $<$ctype.h$>$}\par
{\tt \#include \char`\"{}srec.h\char`\"{}}\par
\subsection*{Defines}
\begin{CompactItemize}
\item 
\#define {\bf C1}(l, p)\ ({\bf ctab}[l[p]])
\item 
\#define {\bf C2}(l, p)\ ((C1(l,p)$<$$<$4)$|$C1(l,p+1))
\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
int {\bf srec\_\-decode} ({\bf srec\_\-t} $\ast$srec, char $\ast$\_\-line)
\item 
int {\bf srec\_\-encode} ({\bf srec\_\-t} $\ast$srec, char $\ast$line)
\item 
char $\ast$ {\bf srec\_\-strerror} (int error)
\end{CompactItemize}
\subsection*{Variables}
\begin{CompactItemize}
\item 
signed char {\bf ctab} [256]
\item 
int {\bf ltab} [10] = \{4,4,6,8,0,4,0,8,6,4\}
\end{CompactItemize}


\subsection{Define Documentation}
\index{firmdl/srec.c@{firmdl/srec.c}!C1@{C1}}
\index{C1@{C1}!firmdl/srec.c@{firmdl/srec.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define C1(l, p)\ ({\bf ctab}[l[p]])}\label{firmdl_2srec_8c_a0}




Definition at line 55 of file srec.c.\index{firmdl/srec.c@{firmdl/srec.c}!C2@{C2}}
\index{C2@{C2}!firmdl/srec.c@{firmdl/srec.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define C2(l, p)\ ((C1(l,p)$<$$<$4)$|$C1(l,p+1))}\label{firmdl_2srec_8c_a1}




Definition at line 56 of file srec.c.

\subsection{Function Documentation}
\index{firmdl/srec.c@{firmdl/srec.c}!srec_decode@{srec\_\-decode}}
\index{srec_decode@{srec\_\-decode}!firmdl/srec.c@{firmdl/srec.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int srec\_\-decode ({\bf srec\_\-t} $\ast$ {\em srec}, char $\ast$ {\em \_\-line})}\label{firmdl_2srec_8c_a4}




Definition at line 61 of file srec.c.

References srec\_\-t::addr, C1, C2, srec\_\-t::count, srec\_\-t::data, ltab, SREC\_\-DATA\_\-SIZE, and srec\_\-t::type.

Referenced by image\_\-load(), main(), and srec\_\-load().\index{firmdl/srec.c@{firmdl/srec.c}!srec_encode@{srec\_\-encode}}
\index{srec_encode@{srec\_\-encode}!firmdl/srec.c@{firmdl/srec.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int srec\_\-encode ({\bf srec\_\-t} $\ast$ {\em srec}, char $\ast$ {\em line})}\label{firmdl_2srec_8c_a5}




Definition at line 131 of file srec.c.

References srec\_\-t::addr, srec\_\-t::count, srec\_\-t::data, ltab, and srec\_\-t::type.\index{firmdl/srec.c@{firmdl/srec.c}!srec_strerror@{srec\_\-strerror}}
\index{srec_strerror@{srec\_\-strerror}!firmdl/srec.c@{firmdl/srec.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}char$\ast$ srec\_\-strerror (int {\em error})}\label{firmdl_2srec_8c_a6}




Definition at line 168 of file srec.c.

References SREC\_\-INVALID\_\-CHAR, SREC\_\-INVALID\_\-CKSUM, SREC\_\-INVALID\_\-HDR, SREC\_\-INVALID\_\-LEN, SREC\_\-NULL, SREC\_\-OK, SREC\_\-TOO\_\-LONG, and SREC\_\-TOO\_\-SHORT.

Referenced by main(), and srec\_\-load().

\subsection{Variable Documentation}
\index{firmdl/srec.c@{firmdl/srec.c}!ctab@{ctab}}
\index{ctab@{ctab}!firmdl/srec.c@{firmdl/srec.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}signed char {\bf ctab}[256]\hspace{0.3cm}{\tt  [static]}}\label{firmdl_2srec_8c_a2}


{\bf Initial value:}

\footnotesize\begin{verbatim} {
    -1,-1,-1,-1,-1,-1,-1,-1,  -1,-1,-1,-1,-1,-1,-1,-1,
    -1,-1,-1,-1,-1,-1,-1,-1,  -1,-1,-1,-1,-1,-1,-1,-1,
    -1,-1,-1,-1,-1,-1,-1,-1,  -1,-1,-1,-1,-1,-1,-1,-1,
     0, 1, 2, 3, 4, 5, 6, 7,   8, 9,-1,-1,-1,-1,-1,-1,
    -1,10,11,12,13,14,15,-1,  -1,-1,-1,-1,-1,-1,-1,-1,
    -1,-1,-1,-1,-1,-1,-1,-1,  -1,-1,-1,-1,-1,-1,-1,-1,
    -1,10,11,12,13,14,15,-1,  -1,-1,-1,-1,-1,-1,-1,-1,
    -1,-1,-1,-1,-1,-1,-1,-1,  -1,-1,-1,-1,-1,-1,-1,-1,
    -1,-1,-1,-1,-1,-1,-1,-1,  -1,-1,-1,-1,-1,-1,-1,-1,
    -1,-1,-1,-1,-1,-1,-1,-1,  -1,-1,-1,-1,-1,-1,-1,-1,
    -1,-1,-1,-1,-1,-1,-1,-1,  -1,-1,-1,-1,-1,-1,-1,-1,
    -1,-1,-1,-1,-1,-1,-1,-1,  -1,-1,-1,-1,-1,-1,-1,-1,
    -1,-1,-1,-1,-1,-1,-1,-1,  -1,-1,-1,-1,-1,-1,-1,-1,
    -1,-1,-1,-1,-1,-1,-1,-1,  -1,-1,-1,-1,-1,-1,-1,-1,
    -1,-1,-1,-1,-1,-1,-1,-1,  -1,-1,-1,-1,-1,-1,-1,-1,
    -1,-1,-1,-1,-1,-1,-1,-1,  -1,-1,-1,-1,-1,-1,-1,-1,
}
\end{verbatim}\normalsize 


Definition at line 32 of file srec.c.\index{firmdl/srec.c@{firmdl/srec.c}!ltab@{ltab}}
\index{ltab@{ltab}!firmdl/srec.c@{firmdl/srec.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int {\bf ltab}[10] = \{4,4,6,8,0,4,0,8,6,4\}\hspace{0.3cm}{\tt  [static]}}\label{firmdl_2srec_8c_a3}




Definition at line 51 of file srec.c.

Referenced by srec\_\-decode(), and srec\_\-encode().