\section{util/dll-src/convert.c File Reference}
\label{convert_8c}\index{util/dll-src/convert.c@{util/dll-src/convert.c}}
{\tt \#include $<$stdio.h$>$}\par
{\tt \#include $<$stdlib.h$>$}\par
{\tt \#include $<$unistd.h$>$}\par
{\tt \#include $<$string.h$>$}\par
{\tt \#include $<$fcntl.h$>$}\par
{\tt \#include $<$sys/time.h$>$}\par
{\tt \#include $<$sys/types.h$>$}\par
{\tt \#include $<$signal.h$>$}\par
{\tt \#include $<$errno.h$>$}\par
{\tt \#include $<$srecload.h$>$}\par
{\tt \#include $<$lx.h$>$}\par
{\tt \#include $<$getopt.h$>$}\par
\subsection*{Defines}
\begin{CompactItemize}
\item 
\#define {\bf DEFAULT\_\-STACK\_\-SIZE}\ 1024
\begin{CompactList}\small\item\em default program stack size \item\end{CompactList}\item 
\#define {\bf RELOC\_\-MAX}\ 16384
\begin{CompactList}\small\item\em maximum number of relocations \item\end{CompactList}\item 
\#define {\bf HAVE\_\-GETOPT\_\-LONG}\ 1
\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
void {\bf lx\_\-from\_\-images} ({\bf lx\_\-t} $\ast$lx, {\bf image\_\-t} $\ast$img, unsigned short stack\_\-size)
\begin{CompactList}\small\item\em build Brick\-OS executable from images \item\end{CompactList}\item 
int {\bf main} (int argc, char $\ast$$\ast$argv)
\begin{CompactList}\small\item\em the user {\bf main()}{\rm (p.\,\pageref{fontdesign_8c_a1})} \item\end{CompactList}\end{CompactItemize}
\subsection*{Variables}
\begin{CompactItemize}
\item 
const struct option {\bf long\_\-options} [$\,$]
\begin{CompactList}\small\item\em long command-line options \item\end{CompactList}\item 
int {\bf verbose\_\-flag} = 0
\begin{CompactList}\small\item\em display some diagnostics if non-zero \item\end{CompactList}\end{CompactItemize}


\subsection{Define Documentation}
\index{convert.c@{convert.c}!DEFAULT_STACK_SIZE@{DEFAULT\_\-STACK\_\-SIZE}}
\index{DEFAULT_STACK_SIZE@{DEFAULT\_\-STACK\_\-SIZE}!convert.c@{convert.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define DEFAULT\_\-STACK\_\-SIZE\ 1024}\label{convert_8c_a0}


default program stack size 



Definition at line 43 of file convert.c.\index{convert.c@{convert.c}!HAVE_GETOPT_LONG@{HAVE\_\-GETOPT\_\-LONG}}
\index{HAVE_GETOPT_LONG@{HAVE\_\-GETOPT\_\-LONG}!convert.c@{convert.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define HAVE\_\-GETOPT\_\-LONG\ 1}\label{convert_8c_a2}




Definition at line 50 of file convert.c.\index{convert.c@{convert.c}!RELOC_MAX@{RELOC\_\-MAX}}
\index{RELOC_MAX@{RELOC\_\-MAX}!convert.c@{convert.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define RELOC\_\-MAX\ 16384}\label{convert_8c_a1}


maximum number of relocations 



Definition at line 44 of file convert.c.

Referenced by lx\_\-from\_\-images().

\subsection{Function Documentation}
\index{convert.c@{convert.c}!lx_from_images@{lx\_\-from\_\-images}}
\index{lx_from_images@{lx\_\-from\_\-images}!convert.c@{convert.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void lx\_\-from\_\-images ({\bf lx\_\-t} $\ast$ {\em lx}, {\bf image\_\-t} $\ast$ {\em img}, unsigned short {\em stack\_\-size})}\label{convert_8c_a5}


build Brick\-OS executable from images 

the segment sizes and start offset need to be set already. 

Definition at line 76 of file convert.c.

References lx\_\-t::base, image\_\-t::base, lx\_\-t::bss\_\-size, image\_\-t::bss\_\-size, lx\_\-t::data\_\-size, image\_\-t::data\_\-size, exit(), malloc(), memcpy(), lx\_\-t::num\_\-relocs, lx\_\-t::offset, image\_\-t::offset, lx\_\-t::reloc, RELOC\_\-MAX, lx\_\-t::stack\_\-size, image\_\-t::text, lx\_\-t::text, lx\_\-t::text\_\-size, image\_\-t::text\_\-size, and lx\_\-t::version.

Referenced by main().\index{convert.c@{convert.c}!main@{main}}
\index{main@{main}!convert.c@{convert.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int main (int {\em argc}, char $\ast$$\ast$ {\em argv})}\label{convert_8c_a6}


the user {\bf main()}{\rm (p.\,\pageref{fontdesign_8c_a1})} 



Definition at line 165 of file convert.c.

References lx\_\-t::base, lx\_\-t::bss\_\-size, lx\_\-t::data\_\-size, exit(), image\_\-load(), long\_\-options, lx\_\-from\_\-images(), lx\_\-write(), lx\_\-t::num\_\-relocs, lx\_\-t::offset, lx\_\-t::stack\_\-size, lx\_\-t::text\_\-size, verbose\_\-flag, and lx\_\-t::version.

\subsection{Variable Documentation}
\index{convert.c@{convert.c}!long_options@{long\_\-options}}
\index{long_options@{long\_\-options}!convert.c@{convert.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const struct option {\bf long\_\-options}[$\,$]\hspace{0.3cm}{\tt  [static]}}\label{convert_8c_a3}


{\bf Initial value:}

\footnotesize\begin{verbatim}{
  {"stack"  ,required_argument,0,'s'},
  {"verbose",no_argument      ,0,'v'},
  {"display",no_argument      ,0,'d'},
  {0        ,0                ,0,0  }
}
\end{verbatim}\normalsize 
long command-line options 



Definition at line 57 of file convert.c.

Referenced by main().\index{convert.c@{convert.c}!verbose_flag@{verbose\_\-flag}}
\index{verbose_flag@{verbose\_\-flag}!convert.c@{convert.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int {\bf verbose\_\-flag} = 0}\label{convert_8c_a4}


display some diagnostics if non-zero 



Definition at line 70 of file convert.c.

Referenced by main().