\hypertarget{luac_8c}{
\section{luac.c File Reference}
\label{luac_8c}\index{luac.c@{luac.c}}
}
{\tt \#include $<$errno.h$>$}\par
{\tt \#include $<$stdio.h$>$}\par
{\tt \#include $<$stdlib.h$>$}\par
{\tt \#include $<$string.h$>$}\par
{\tt \#include \char`\"{}lua.h\char`\"{}}\par
{\tt \#include \char`\"{}lauxlib.h\char`\"{}}\par
{\tt \#include \char`\"{}ldo.h\char`\"{}}\par
{\tt \#include \char`\"{}lfunc.h\char`\"{}}\par
{\tt \#include \char`\"{}lmem.h\char`\"{}}\par
{\tt \#include \char`\"{}lobject.h\char`\"{}}\par
{\tt \#include \char`\"{}lopcodes.h\char`\"{}}\par
{\tt \#include \char`\"{}lstring.h\char`\"{}}\par
{\tt \#include \char`\"{}lundump.h\char`\"{}}\par
\subsection*{Classes}
\begin{CompactItemize}
\item 
struct \hyperlink{structSmain}{Smain}
\end{CompactItemize}
\subsection*{Defines}
\begin{CompactItemize}
\item 
\#define \hyperlink{luac_8c_c70e1c4c97135b89ba757fb14b14951b}{luac\_\-c}
\item 
\#define \hyperlink{luac_8c_bf0b3947b59218777a8e928a10be205b}{LUA\_\-CORE}
\item 
\#define \hyperlink{luac_8c_8c9afb758de9a0355c93fc926b8ce6b1}{PROGNAME}~\char`\"{}luac\char`\"{}
\item 
\#define \hyperlink{luac_8c_61a3c9a18380aafb6e430e79bf596557}{OUTPUT}~PROGNAME \char`\"{}.out\char`\"{}
\item 
\#define \hyperlink{luac_8c_a34c724b8aa48c2379fe48ecdb26927b}{IS}(s)~(strcmp(argv\mbox{[}i\mbox{]},s)==0)
\item 
\#define \hyperlink{luac_8c_395e76b71aa94b35fda84c1edaf01d06}{toproto}(\hyperlink{main_8c_62f94dfc0036bec0c14106c2f15caf3e}{L}, i)~(clvalue(\hyperlink{main_8c_62f94dfc0036bec0c14106c2f15caf3e}{L} $\rightarrow$ top+(i)) $\rightarrow$ l.p)
\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
static void \hyperlink{luac_8c_69302890c425d9c594142a85921d8940}{fatal} (const char $\ast$message)
\item 
static void \hyperlink{luac_8c_c44bc787b819b46617c02a16a3ba9d4a}{cannot} (const char $\ast$what)
\item 
static void \hyperlink{luac_8c_84bceac26a8794d42d22ce68a71d3163}{usage} (const char $\ast$message)
\item 
static int \hyperlink{luac_8c_2ebf2a3b04448d1d3561e178f4be9e82}{doargs} (int argc, char $\ast$argv\mbox{[}$\,$\mbox{]})
\item 
static const \hyperlink{structProto}{Proto} $\ast$ \hyperlink{luac_8c_6a5f29f866b4329c8ec87cb01eddb100}{combine} (\hyperlink{structlua__State}{lua\_\-State} $\ast$\hyperlink{main_8c_62f94dfc0036bec0c14106c2f15caf3e}{L}, int n)
\item 
static int \hyperlink{luac_8c_85d6a36e2c08a094c859d9a0a2348f49}{writer} (\hyperlink{structlua__State}{lua\_\-State} $\ast$\hyperlink{main_8c_62f94dfc0036bec0c14106c2f15caf3e}{L}, const void $\ast$p, size\_\-t size, void $\ast$u)
\item 
static int \hyperlink{luac_8c_a0f8bc082ef913cb0a4df437bf5f5019}{pmain} (\hyperlink{structlua__State}{lua\_\-State} $\ast$\hyperlink{main_8c_62f94dfc0036bec0c14106c2f15caf3e}{L})
\item 
int \hyperlink{luac_8c_0ddf1224851353fc92bfbff6f499fa97}{main} (int argc, char $\ast$argv\mbox{[}$\,$\mbox{]})
\end{CompactItemize}
\subsection*{Variables}
\begin{CompactItemize}
\item 
static int \hyperlink{luac_8c_fe985de9b8de27991fde6ff1a38df0d5}{listing} = 0
\item 
static int \hyperlink{luac_8c_58aee6c9626ed8d2bf3d5d4415195b3e}{dumping} = 1
\item 
static int \hyperlink{luac_8c_25df061e9704e4ffd10f50e5e8823773}{stripping} = 0
\item 
static char \hyperlink{luac_8c_a53971c93198f18e062267f4d976a5cf}{Output} \mbox{[}$\,$\mbox{]} = \{ OUTPUT \}
\item 
static const char $\ast$ \hyperlink{luac_8c_5a832fe6e2412dfabb93a2adae30e745}{output} = \hyperlink{luac_8c_a53971c93198f18e062267f4d976a5cf}{Output}
\item 
static const char $\ast$ \hyperlink{luac_8c_d785d8a8f8ff378aa21eb1fa7a6085df}{progname} = PROGNAME
\end{CompactItemize}


\subsection{Define Documentation}
\hypertarget{luac_8c_a34c724b8aa48c2379fe48ecdb26927b}{
\index{luac.c@{luac.c}!IS@{IS}}
\index{IS@{IS}!luac.c@{luac.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define IS(s)~(strcmp(argv\mbox{[}i\mbox{]},s)==0)}}
\label{luac_8c_a34c724b8aa48c2379fe48ecdb26927b}


\hypertarget{luac_8c_bf0b3947b59218777a8e928a10be205b}{
\index{luac.c@{luac.c}!LUA\_\-CORE@{LUA\_\-CORE}}
\index{LUA\_\-CORE@{LUA\_\-CORE}!luac.c@{luac.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define LUA\_\-CORE}}
\label{luac_8c_bf0b3947b59218777a8e928a10be205b}


\hypertarget{luac_8c_c70e1c4c97135b89ba757fb14b14951b}{
\index{luac.c@{luac.c}!luac\_\-c@{luac\_\-c}}
\index{luac\_\-c@{luac\_\-c}!luac.c@{luac.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define luac\_\-c}}
\label{luac_8c_c70e1c4c97135b89ba757fb14b14951b}


\hypertarget{luac_8c_61a3c9a18380aafb6e430e79bf596557}{
\index{luac.c@{luac.c}!OUTPUT@{OUTPUT}}
\index{OUTPUT@{OUTPUT}!luac.c@{luac.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define OUTPUT~PROGNAME \char`\"{}.out\char`\"{}}}
\label{luac_8c_61a3c9a18380aafb6e430e79bf596557}


\hypertarget{luac_8c_8c9afb758de9a0355c93fc926b8ce6b1}{
\index{luac.c@{luac.c}!PROGNAME@{PROGNAME}}
\index{PROGNAME@{PROGNAME}!luac.c@{luac.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define PROGNAME~\char`\"{}luac\char`\"{}}}
\label{luac_8c_8c9afb758de9a0355c93fc926b8ce6b1}


\hypertarget{luac_8c_395e76b71aa94b35fda84c1edaf01d06}{
\index{luac.c@{luac.c}!toproto@{toproto}}
\index{toproto@{toproto}!luac.c@{luac.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define toproto({\bf L}, \/  i)~(clvalue({\bf L} $\rightarrow$ top+(i)) $\rightarrow$ l.p)}}
\label{luac_8c_395e76b71aa94b35fda84c1edaf01d06}




\subsection{Function Documentation}
\hypertarget{luac_8c_c44bc787b819b46617c02a16a3ba9d4a}{
\index{luac.c@{luac.c}!cannot@{cannot}}
\index{cannot@{cannot}!luac.c@{luac.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}static void cannot (const char $\ast$ {\em what})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{luac_8c_c44bc787b819b46617c02a16a3ba9d4a}


\hypertarget{luac_8c_6a5f29f866b4329c8ec87cb01eddb100}{
\index{luac.c@{luac.c}!combine@{combine}}
\index{combine@{combine}!luac.c@{luac.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}static const {\bf Proto}$\ast$ combine ({\bf lua\_\-State} $\ast$ {\em L}, \/  int {\em n})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{luac_8c_6a5f29f866b4329c8ec87cb01eddb100}


\hypertarget{luac_8c_2ebf2a3b04448d1d3561e178f4be9e82}{
\index{luac.c@{luac.c}!doargs@{doargs}}
\index{doargs@{doargs}!luac.c@{luac.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}static int doargs (int {\em argc}, \/  char $\ast$ {\em argv}\mbox{[}$\,$\mbox{]})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{luac_8c_2ebf2a3b04448d1d3561e178f4be9e82}


\hypertarget{luac_8c_69302890c425d9c594142a85921d8940}{
\index{luac.c@{luac.c}!fatal@{fatal}}
\index{fatal@{fatal}!luac.c@{luac.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}static void fatal (const char $\ast$ {\em message})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{luac_8c_69302890c425d9c594142a85921d8940}


\hypertarget{luac_8c_0ddf1224851353fc92bfbff6f499fa97}{
\index{luac.c@{luac.c}!main@{main}}
\index{main@{main}!luac.c@{luac.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int main (int {\em argc}, \/  char $\ast$ {\em argv}\mbox{[}$\,$\mbox{]})}}
\label{luac_8c_0ddf1224851353fc92bfbff6f499fa97}


\hypertarget{luac_8c_a0f8bc082ef913cb0a4df437bf5f5019}{
\index{luac.c@{luac.c}!pmain@{pmain}}
\index{pmain@{pmain}!luac.c@{luac.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}static int pmain ({\bf lua\_\-State} $\ast$ {\em L})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{luac_8c_a0f8bc082ef913cb0a4df437bf5f5019}


\hypertarget{luac_8c_84bceac26a8794d42d22ce68a71d3163}{
\index{luac.c@{luac.c}!usage@{usage}}
\index{usage@{usage}!luac.c@{luac.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}static void usage (const char $\ast$ {\em message})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{luac_8c_84bceac26a8794d42d22ce68a71d3163}


\hypertarget{luac_8c_85d6a36e2c08a094c859d9a0a2348f49}{
\index{luac.c@{luac.c}!writer@{writer}}
\index{writer@{writer}!luac.c@{luac.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}static int writer ({\bf lua\_\-State} $\ast$ {\em L}, \/  const void $\ast$ {\em p}, \/  size\_\-t {\em size}, \/  void $\ast$ {\em u})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{luac_8c_85d6a36e2c08a094c859d9a0a2348f49}




\subsection{Variable Documentation}
\hypertarget{luac_8c_58aee6c9626ed8d2bf3d5d4415195b3e}{
\index{luac.c@{luac.c}!dumping@{dumping}}
\index{dumping@{dumping}!luac.c@{luac.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int {\bf dumping} = 1\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{luac_8c_58aee6c9626ed8d2bf3d5d4415195b3e}


\hypertarget{luac_8c_fe985de9b8de27991fde6ff1a38df0d5}{
\index{luac.c@{luac.c}!listing@{listing}}
\index{listing@{listing}!luac.c@{luac.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int {\bf listing} = 0\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{luac_8c_fe985de9b8de27991fde6ff1a38df0d5}


\hypertarget{luac_8c_5a832fe6e2412dfabb93a2adae30e745}{
\index{luac.c@{luac.c}!output@{output}}
\index{output@{output}!luac.c@{luac.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const char$\ast$ {\bf output} = {\bf Output}\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{luac_8c_5a832fe6e2412dfabb93a2adae30e745}


\hypertarget{luac_8c_a53971c93198f18e062267f4d976a5cf}{
\index{luac.c@{luac.c}!Output@{Output}}
\index{Output@{Output}!luac.c@{luac.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}char {\bf Output}\mbox{[}$\,$\mbox{]} = \{ OUTPUT \}\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{luac_8c_a53971c93198f18e062267f4d976a5cf}


\hypertarget{luac_8c_d785d8a8f8ff378aa21eb1fa7a6085df}{
\index{luac.c@{luac.c}!progname@{progname}}
\index{progname@{progname}!luac.c@{luac.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const char$\ast$ {\bf progname} = PROGNAME\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{luac_8c_d785d8a8f8ff378aa21eb1fa7a6085df}


\hypertarget{luac_8c_25df061e9704e4ffd10f50e5e8823773}{
\index{luac.c@{luac.c}!stripping@{stripping}}
\index{stripping@{stripping}!luac.c@{luac.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int {\bf stripping} = 0\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{luac_8c_25df061e9704e4ffd10f50e5e8823773}


