\hypertarget{group__Elua}{}\doxysection{Elua}
\label{group__Elua}\index{Elua@{Elua}}
\doxysubsection*{Typedefs}
\begin{DoxyCompactItemize}
\item 
typedef struct \+\_\+\+Elua\+\_\+\+State \mbox{\hyperlink{group__Elua_ga688a5ca32c81bcaf4811f688c3fec981}{Elua\+\_\+\+State}}
\begin{DoxyCompactList}\small\item\em Opaque Elua state. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
EAPI int \mbox{\hyperlink{group__Elua_gacf7fc6f0386d30e4af4fcb8fd424c8dc}{elua\+\_\+init}} (void)
\begin{DoxyCompactList}\small\item\em Initialize the Elua library. \end{DoxyCompactList}\item 
EAPI int \mbox{\hyperlink{group__Elua_ga8364635553424c58bdbb50f9bb842d9b}{elua\+\_\+shutdown}} (void)
\begin{DoxyCompactList}\small\item\em Shutdown the Elua library. \end{DoxyCompactList}\item 
EAPI \mbox{\hyperlink{group__Elua_ga688a5ca32c81bcaf4811f688c3fec981}{Elua\+\_\+\+State}} $\ast$ \mbox{\hyperlink{group__Elua_gaf987730a26870534b99a933576bac1ec}{elua\+\_\+state\+\_\+new}} (const char $\ast$progname)
\begin{DoxyCompactList}\small\item\em Create a new Elua state. \end{DoxyCompactList}\item 
EAPI \mbox{\hyperlink{group__Elua_ga688a5ca32c81bcaf4811f688c3fec981}{Elua\+\_\+\+State}} $\ast$ \mbox{\hyperlink{group__Elua_ga440d9b07798523d0162cf395243a5be2}{elua\+\_\+state\+\_\+from\+\_\+lua\+\_\+state\+\_\+get}} (lua\+\_\+\+State $\ast$L)
\begin{DoxyCompactList}\small\item\em Retrieve an Elua state from a Lua state. \end{DoxyCompactList}\item 
EAPI void \mbox{\hyperlink{group__Elua_ga20ec17a66199e38fe108d522bbf32349}{elua\+\_\+state\+\_\+free}} (\mbox{\hyperlink{group__Elua_ga688a5ca32c81bcaf4811f688c3fec981}{Elua\+\_\+\+State}} $\ast$es)
\begin{DoxyCompactList}\small\item\em Destroy an Elua state. \end{DoxyCompactList}\item 
EAPI void \mbox{\hyperlink{group__Elua_ga92e75b39e56082d05c2beb7bdf401a15}{elua\+\_\+state\+\_\+dirs\+\_\+set}} (\mbox{\hyperlink{group__Elua_ga688a5ca32c81bcaf4811f688c3fec981}{Elua\+\_\+\+State}} $\ast$es, const char $\ast$core, const char $\ast$mods, const char $\ast$apps)
\begin{DoxyCompactList}\small\item\em Set the Elua directory paths. \end{DoxyCompactList}\item 
EAPI void \mbox{\hyperlink{group__Elua_ga3ef02ac4acf29212793720849391d4b8}{elua\+\_\+state\+\_\+dirs\+\_\+fill}} (\mbox{\hyperlink{group__Elua_ga688a5ca32c81bcaf4811f688c3fec981}{Elua\+\_\+\+State}} $\ast$es, \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool}} ignore\+\_\+env)
\begin{DoxyCompactList}\small\item\em Fill the currently unset Elua dirs. \end{DoxyCompactList}\item 
EAPI \mbox{\hyperlink{group__Eina__Stringshare__Group_ga2b7dc19609a55e630a96cc1396e38a53}{Eina\+\_\+\+Stringshare}} $\ast$ \mbox{\hyperlink{group__Elua_ga6a1fd985975cf6cb22441aa419b5bd2d}{elua\+\_\+state\+\_\+core\+\_\+dir\+\_\+get}} (const \mbox{\hyperlink{group__Elua_ga688a5ca32c81bcaf4811f688c3fec981}{Elua\+\_\+\+State}} $\ast$es)
\begin{DoxyCompactList}\small\item\em Retrieve the Elua core dir. \end{DoxyCompactList}\item 
EAPI \mbox{\hyperlink{group__Eina__Stringshare__Group_ga2b7dc19609a55e630a96cc1396e38a53}{Eina\+\_\+\+Stringshare}} $\ast$ \mbox{\hyperlink{group__Elua_ga3dba5ae7f1aaefd681c4e4c219d9cabe}{elua\+\_\+state\+\_\+mod\+\_\+dir\+\_\+get}} (const \mbox{\hyperlink{group__Elua_ga688a5ca32c81bcaf4811f688c3fec981}{Elua\+\_\+\+State}} $\ast$es)
\begin{DoxyCompactList}\small\item\em Retrieve the Elua module dir. \end{DoxyCompactList}\item 
EAPI \mbox{\hyperlink{group__Eina__Stringshare__Group_ga2b7dc19609a55e630a96cc1396e38a53}{Eina\+\_\+\+Stringshare}} $\ast$ \mbox{\hyperlink{group__Elua_ga2876193e67462944422bbae57d796bee}{elua\+\_\+state\+\_\+apps\+\_\+dir\+\_\+get}} (const \mbox{\hyperlink{group__Elua_ga688a5ca32c81bcaf4811f688c3fec981}{Elua\+\_\+\+State}} $\ast$es)
\begin{DoxyCompactList}\small\item\em Retrieve the Elua apps dir. \end{DoxyCompactList}\item 
EAPI \mbox{\hyperlink{group__Eina__Stringshare__Group_ga2b7dc19609a55e630a96cc1396e38a53}{Eina\+\_\+\+Stringshare}} $\ast$ \mbox{\hyperlink{group__Elua_gad5d34af0d7ad95327b368e1c99614e2b}{elua\+\_\+state\+\_\+prog\+\_\+name\+\_\+get}} (const \mbox{\hyperlink{group__Elua_ga688a5ca32c81bcaf4811f688c3fec981}{Elua\+\_\+\+State}} $\ast$es)
\begin{DoxyCompactList}\small\item\em Retrieve the prog name set on state creation. \end{DoxyCompactList}\item 
EAPI void \mbox{\hyperlink{group__Elua_ga1c0e7c790bcfb9f0e9b19295d6e953f4}{elua\+\_\+state\+\_\+include\+\_\+path\+\_\+add}} (\mbox{\hyperlink{group__Elua_ga688a5ca32c81bcaf4811f688c3fec981}{Elua\+\_\+\+State}} $\ast$es, const char $\ast$path)
\begin{DoxyCompactList}\small\item\em Add another path to look up modules in to the state. \end{DoxyCompactList}\item 
EAPI \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool}} \mbox{\hyperlink{group__Elua_gaa25a6712cc9fe309050b90f577ed4721}{elua\+\_\+state\+\_\+require\+\_\+ref\+\_\+push}} (\mbox{\hyperlink{group__Elua_ga688a5ca32c81bcaf4811f688c3fec981}{Elua\+\_\+\+State}} $\ast$es)
\begin{DoxyCompactList}\small\item\em Push the Elua \char`\"{}require\char`\"{} function onto the Lua stack. \end{DoxyCompactList}\item 
EAPI \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool}} \mbox{\hyperlink{group__Elua_gaeb1c950c4487106cdb2ed1d915ef4dd4}{elua\+\_\+state\+\_\+appload\+\_\+ref\+\_\+push}} (\mbox{\hyperlink{group__Elua_ga688a5ca32c81bcaf4811f688c3fec981}{Elua\+\_\+\+State}} $\ast$es)
\begin{DoxyCompactList}\small\item\em Push the Elua app loader function onto the Lua stack. \end{DoxyCompactList}\item 
EAPI lua\+\_\+\+State $\ast$ \mbox{\hyperlink{group__Elua_ga86f07252060fe9ab1a2984d68f595d15}{elua\+\_\+state\+\_\+lua\+\_\+state\+\_\+get}} (const \mbox{\hyperlink{group__Elua_ga688a5ca32c81bcaf4811f688c3fec981}{Elua\+\_\+\+State}} $\ast$es)
\begin{DoxyCompactList}\small\item\em Retrieve the Lua state from an Elua state. \end{DoxyCompactList}\item 
EAPI \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool}} \mbox{\hyperlink{group__Elua_ga0a4d8913fce4bb564a3ae7935e1f29a5}{elua\+\_\+state\+\_\+setup}} (\mbox{\hyperlink{group__Elua_ga688a5ca32c81bcaf4811f688c3fec981}{Elua\+\_\+\+State}} $\ast$es)
\begin{DoxyCompactList}\small\item\em Set up the Elua state. \end{DoxyCompactList}\item 
EAPI int \mbox{\hyperlink{group__Elua_gaaf5c1391a7660da2bb633e15dbeb8b68}{elua\+\_\+io\+\_\+loadfile}} (const \mbox{\hyperlink{group__Elua_ga688a5ca32c81bcaf4811f688c3fec981}{Elua\+\_\+\+State}} $\ast$es, const char $\ast$fname)
\begin{DoxyCompactList}\small\item\em Loads a file using Elua\textquotesingle{}s own mmap-\/based IO. \end{DoxyCompactList}\item 
EAPI \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool}} \mbox{\hyperlink{group__Elua_gafde1f73d35f2521d3812b72b2c3542c1}{elua\+\_\+util\+\_\+require}} (\mbox{\hyperlink{group__Elua_ga688a5ca32c81bcaf4811f688c3fec981}{Elua\+\_\+\+State}} $\ast$es, const char $\ast$libname)
\begin{DoxyCompactList}\small\item\em Requires a module. \end{DoxyCompactList}\item 
EAPI \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool}} \mbox{\hyperlink{group__Elua_ga7a9f852864e3e14dc517fa23ad1167c5}{elua\+\_\+util\+\_\+file\+\_\+run}} (\mbox{\hyperlink{group__Elua_ga688a5ca32c81bcaf4811f688c3fec981}{Elua\+\_\+\+State}} $\ast$es, const char $\ast$fname)
\begin{DoxyCompactList}\small\item\em Runs a file. \end{DoxyCompactList}\item 
EAPI \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool}} \mbox{\hyperlink{group__Elua_ga7936ab36149c7572cc756fe5db6bf91d}{elua\+\_\+util\+\_\+string\+\_\+run}} (\mbox{\hyperlink{group__Elua_ga688a5ca32c81bcaf4811f688c3fec981}{Elua\+\_\+\+State}} $\ast$es, const char $\ast$chunk, const char $\ast$chname)
\begin{DoxyCompactList}\small\item\em Runs a string. \end{DoxyCompactList}\item 
EAPI int \mbox{\hyperlink{group__Elua_ga8804ca091a1310f62cab73d592b55f99}{elua\+\_\+util\+\_\+app\+\_\+load}} (\mbox{\hyperlink{group__Elua_ga688a5ca32c81bcaf4811f688c3fec981}{Elua\+\_\+\+State}} $\ast$es, const char $\ast$appname)
\begin{DoxyCompactList}\small\item\em Loads an application. \end{DoxyCompactList}\item 
EAPI \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool}} \mbox{\hyperlink{group__Elua_ga003f5ca8e27d1249f6531318edb65456}{elua\+\_\+util\+\_\+script\+\_\+run}} (\mbox{\hyperlink{group__Elua_ga688a5ca32c81bcaf4811f688c3fec981}{Elua\+\_\+\+State}} $\ast$es, int argc, char $\ast$$\ast$argv, int n, int $\ast$quit)
\begin{DoxyCompactList}\small\item\em Runs a script. \end{DoxyCompactList}\item 
EAPI int \mbox{\hyperlink{group__Elua_ga9c5bed4721ba3cc5b8778c59b0c98886}{elua\+\_\+util\+\_\+error\+\_\+report}} (const \mbox{\hyperlink{group__Elua_ga688a5ca32c81bcaf4811f688c3fec981}{Elua\+\_\+\+State}} $\ast$es, int status)
\begin{DoxyCompactList}\small\item\em Reports an error using Eina logging. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}


\doxysubsection{Typedef Documentation}
\mbox{\Hypertarget{group__Elua_ga688a5ca32c81bcaf4811f688c3fec981}\label{group__Elua_ga688a5ca32c81bcaf4811f688c3fec981}} 
\index{Elua@{Elua}!Elua\_State@{Elua\_State}}
\index{Elua\_State@{Elua\_State}!Elua@{Elua}}
\doxysubsubsection{\texorpdfstring{Elua\_State}{Elua\_State}}
{\footnotesize\ttfamily typedef struct \+\_\+\+Elua\+\_\+\+State \mbox{\hyperlink{group__Elua_ga688a5ca32c81bcaf4811f688c3fec981}{Elua\+\_\+\+State}}}



Opaque Elua state. 



\doxysubsection{Function Documentation}
\mbox{\Hypertarget{group__Elua_gacf7fc6f0386d30e4af4fcb8fd424c8dc}\label{group__Elua_gacf7fc6f0386d30e4af4fcb8fd424c8dc}} 
\index{Elua@{Elua}!elua\_init@{elua\_init}}
\index{elua\_init@{elua\_init}!Elua@{Elua}}
\doxysubsubsection{\texorpdfstring{elua\_init()}{elua\_init()}}
{\footnotesize\ttfamily EAPI int elua\+\_\+init (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption})}



Initialize the Elua library. 

This initializes the Elua library for usage. It maintains an internal counter so that multiple calls will only increment/decrement correctly.

\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{group__Elua_ga8364635553424c58bdbb50f9bb842d9b}{elua\+\_\+shutdown}} 
\end{DoxySeeAlso}


References \mbox{\hyperlink{group__Ecore__File__Group_ga9497ff8ae37f46464565414711a031d0}{ecore\+\_\+file\+\_\+init()}}, \mbox{\hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{EINA\+\_\+\+FALSE}}, \mbox{\hyperlink{group__Eina__Main__Group_ga81b8137665b8a4d2cb38ca50017d4c74}{eina\+\_\+init()}}, \mbox{\hyperlink{group__Eina__Log__Group_ga79d0a42ab10dd0e7760b33ae33a6aae0}{eina\+\_\+log\+\_\+domain\+\_\+register()}}, \mbox{\hyperlink{group__Eina__Log__Group_ga2e33caeeeb6051526c01b7fea4d6c91b}{EINA\+\_\+\+LOG\+\_\+\+ERR}}, \mbox{\hyperlink{group__Eina__Log__Group_ga079e9de9602815a6de0d5188b65c07a2}{EINA\+\_\+\+LOG\+\_\+\+STATE\+\_\+\+INIT}}, \mbox{\hyperlink{group__Eina__Log__Group_gga125f3b55502884020a1546d0575ae052adcc235504e74cbd641635c0af36e9d47}{EINA\+\_\+\+LOG\+\_\+\+STATE\+\_\+\+STOP}}, \mbox{\hyperlink{group__Eina__Log__Group_gaceb7074e48242643ec8d3d664a32801e}{eina\+\_\+log\+\_\+timing()}}, \mbox{\hyperlink{group__Eina__Prefix__Group_ga92b8591293b0be7c1621e082229e3963}{eina\+\_\+prefix\+\_\+new()}}, and \mbox{\hyperlink{group__Elua_gacf7fc6f0386d30e4af4fcb8fd424c8dc}{elua\+\_\+init()}}.



Referenced by \mbox{\hyperlink{group__Elua_gacf7fc6f0386d30e4af4fcb8fd424c8dc}{elua\+\_\+init()}}.

\mbox{\Hypertarget{group__Elua_ga8364635553424c58bdbb50f9bb842d9b}\label{group__Elua_ga8364635553424c58bdbb50f9bb842d9b}} 
\index{Elua@{Elua}!elua\_shutdown@{elua\_shutdown}}
\index{elua\_shutdown@{elua\_shutdown}!Elua@{Elua}}
\doxysubsubsection{\texorpdfstring{elua\_shutdown()}{elua\_shutdown()}}
{\footnotesize\ttfamily EAPI int elua\+\_\+shutdown (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption})}



Shutdown the Elua library. 

Depending on the internal initialization counter, this either decrements or completely shuts down the Elua library. In any case, call this once for each init call.

\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{group__Elua_gacf7fc6f0386d30e4af4fcb8fd424c8dc}{elua\+\_\+init}} 
\end{DoxySeeAlso}


References \mbox{\hyperlink{group__Ecore__File__Group_gafa64f6af8d6f80acef1a29366a31d55d}{ecore\+\_\+file\+\_\+shutdown()}}, \mbox{\hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{EINA\+\_\+\+FALSE}}, \mbox{\hyperlink{group__Eina__Log__Group_ga61776fa99e910e2d40f77c688c9bee5a}{eina\+\_\+log\+\_\+domain\+\_\+unregister()}}, \mbox{\hyperlink{group__Eina__Log__Group_ga2e33caeeeb6051526c01b7fea4d6c91b}{EINA\+\_\+\+LOG\+\_\+\+ERR}}, \mbox{\hyperlink{group__Eina__Log__Group_ga527ad9352599d503a53bf834868d3461}{EINA\+\_\+\+LOG\+\_\+\+STATE\+\_\+\+SHUTDOWN}}, \mbox{\hyperlink{group__Eina__Log__Group_gga125f3b55502884020a1546d0575ae052a42e956e3a69ea29632f7e9d27a269903}{EINA\+\_\+\+LOG\+\_\+\+STATE\+\_\+\+START}}, \mbox{\hyperlink{group__Eina__Log__Group_gaceb7074e48242643ec8d3d664a32801e}{eina\+\_\+log\+\_\+timing()}}, \mbox{\hyperlink{group__Eina__Prefix__Group_ga5eb719d9e167358b990544a7d57374d3}{eina\+\_\+prefix\+\_\+free()}}, and \mbox{\hyperlink{group__Eina__Main__Group_ga5bf35513199d5220341437c05696285d}{eina\+\_\+shutdown()}}.

\mbox{\Hypertarget{group__Elua_gaf987730a26870534b99a933576bac1ec}\label{group__Elua_gaf987730a26870534b99a933576bac1ec}} 
\index{Elua@{Elua}!elua\_state\_new@{elua\_state\_new}}
\index{elua\_state\_new@{elua\_state\_new}!Elua@{Elua}}
\doxysubsubsection{\texorpdfstring{elua\_state\_new()}{elua\_state\_new()}}
{\footnotesize\ttfamily EAPI \mbox{\hyperlink{group__Elua_ga688a5ca32c81bcaf4811f688c3fec981}{Elua\+\_\+\+State}} $\ast$ elua\+\_\+state\+\_\+new (\begin{DoxyParamCaption}\item[{const char $\ast$}]{progname }\end{DoxyParamCaption})}



Create a new Elua state. 

This creates a new Elua state. An Elua state is externally opaque, but it contains a Lua\+JIT state as well as some additional information that is mostly initialized by other APIs.


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em progname} & The program name that holds the Elua state. This will be used for stuff like error reporting. Typically the same as the binary name of the application (argv\mbox{[}0\mbox{]}). \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
A new Elua state or NULL. 
\end{DoxyReturn}


References \mbox{\hyperlink{group__Eina__Stringshare__Group_ga4e3ce40744291c1fb8574e26883c0bf2}{eina\+\_\+stringshare\+\_\+add()}}, and \mbox{\hyperlink{group__Eina__Stringshare__Group_ga5538b4a134987b8a01744fad1a845ba4}{eina\+\_\+stringshare\+\_\+del()}}.

\mbox{\Hypertarget{group__Elua_ga440d9b07798523d0162cf395243a5be2}\label{group__Elua_ga440d9b07798523d0162cf395243a5be2}} 
\index{Elua@{Elua}!elua\_state\_from\_lua\_state\_get@{elua\_state\_from\_lua\_state\_get}}
\index{elua\_state\_from\_lua\_state\_get@{elua\_state\_from\_lua\_state\_get}!Elua@{Elua}}
\doxysubsubsection{\texorpdfstring{elua\_state\_from\_lua\_state\_get()}{elua\_state\_from\_lua\_state\_get()}}
{\footnotesize\ttfamily EAPI \mbox{\hyperlink{group__Elua_ga688a5ca32c81bcaf4811f688c3fec981}{Elua\+\_\+\+State}} $\ast$ elua\+\_\+state\+\_\+from\+\_\+lua\+\_\+state\+\_\+get (\begin{DoxyParamCaption}\item[{lua\+\_\+\+State $\ast$}]{L }\end{DoxyParamCaption})}



Retrieve an Elua state from a Lua state. 

This doesn\textquotesingle{}t create a new Elua state. Instead it just retrieves an existing Elua state given a Lua state. If no Elua state could be found (for example when the Lua state was created independently of Elua), this function returns NULL.


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em L} & The Lua state. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
An Elua state or NULL. 
\end{DoxyReturn}


References \mbox{\hyperlink{group__Eina__Safety__Checks__Group_gab2b07061fc6500dedd9cd41c8d16f95d}{EINA\+\_\+\+SAFETY\+\_\+\+ON\+\_\+\+NULL\+\_\+\+RETURN\+\_\+\+VAL}}.

\mbox{\Hypertarget{group__Elua_ga20ec17a66199e38fe108d522bbf32349}\label{group__Elua_ga20ec17a66199e38fe108d522bbf32349}} 
\index{Elua@{Elua}!elua\_state\_free@{elua\_state\_free}}
\index{elua\_state\_free@{elua\_state\_free}!Elua@{Elua}}
\doxysubsubsection{\texorpdfstring{elua\_state\_free()}{elua\_state\_free()}}
{\footnotesize\ttfamily EAPI void elua\+\_\+state\+\_\+free (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__Elua_ga688a5ca32c81bcaf4811f688c3fec981}{Elua\+\_\+\+State}} $\ast$}]{es }\end{DoxyParamCaption})}



Destroy an Elua state. 

Given an Elua state, this destroys its internal Lua state as well as all other data its holding and then frees the Elua state itself.


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em es} & The Elua state. \\
\hline
\end{DoxyParams}


References \mbox{\hyperlink{group__Eina__List__Group_ga82a1bfa543e21853f9ea3ff88dd1250b}{eina\+\_\+list\+\_\+free()}}, \mbox{\hyperlink{group__Eina__List__Group_gae27a2c686a0a11693f9b06957c9bba83}{EINA\+\_\+\+LIST\+\_\+\+FREE}}, and \mbox{\hyperlink{group__Eina__Stringshare__Group_ga5538b4a134987b8a01744fad1a845ba4}{eina\+\_\+stringshare\+\_\+del()}}.

\mbox{\Hypertarget{group__Elua_ga92e75b39e56082d05c2beb7bdf401a15}\label{group__Elua_ga92e75b39e56082d05c2beb7bdf401a15}} 
\index{Elua@{Elua}!elua\_state\_dirs\_set@{elua\_state\_dirs\_set}}
\index{elua\_state\_dirs\_set@{elua\_state\_dirs\_set}!Elua@{Elua}}
\doxysubsubsection{\texorpdfstring{elua\_state\_dirs\_set()}{elua\_state\_dirs\_set()}}
{\footnotesize\ttfamily EAPI void elua\+\_\+state\+\_\+dirs\+\_\+set (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__Elua_ga688a5ca32c81bcaf4811f688c3fec981}{Elua\+\_\+\+State}} $\ast$}]{es,  }\item[{const char $\ast$}]{core,  }\item[{const char $\ast$}]{mods,  }\item[{const char $\ast$}]{apps }\end{DoxyParamCaption})}



Set the Elua directory paths. 

Every Elua state needs three paths -\/ the core script path, the module path and the apps path. The core path refers to from where core scripts will be loaded (such as the module system), the module path refers to from where extra modules will be loaded and the apps path refers to from where Elua applications will be loaded (this is not a module path).

If you provide NULL for any path, it will not be set. This allows you to split the setting into multiple calls. By the time of state use all need to be set.

Also, all the paths will be sanitized before setting by calling \mbox{\hyperlink{group__Eina__File__Group_ga4c11cce335038a46c2979f1ecf5f3d33}{eina\+\_\+file\+\_\+path\+\_\+sanitize}} on them.


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em es} & The Elua state. \\
\hline
\mbox{\texttt{ in}}  & {\em core} & The core path. \\
\hline
\mbox{\texttt{ in}}  & {\em mods} & The modules path. \\
\hline
\mbox{\texttt{ in}}  & {\em apps} & The apps path.\\
\hline
\end{DoxyParams}
\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{group__Elua_ga6a1fd985975cf6cb22441aa419b5bd2d}{elua\+\_\+state\+\_\+core\+\_\+dir\+\_\+get}} 

\mbox{\hyperlink{group__Elua_ga3dba5ae7f1aaefd681c4e4c219d9cabe}{elua\+\_\+state\+\_\+mod\+\_\+dir\+\_\+get}} 

\mbox{\hyperlink{group__Elua_ga2876193e67462944422bbae57d796bee}{elua\+\_\+state\+\_\+apps\+\_\+dir\+\_\+get}} 
\end{DoxySeeAlso}


References \mbox{\hyperlink{group__Eina__File__Group_ga4c11cce335038a46c2979f1ecf5f3d33}{eina\+\_\+file\+\_\+path\+\_\+sanitize()}}, \mbox{\hyperlink{group__Eina__Safety__Checks__Group_ga1ccf8538d0015b3801ff642e6156843a}{EINA\+\_\+\+SAFETY\+\_\+\+ON\+\_\+\+NULL\+\_\+\+RETURN}}, \mbox{\hyperlink{group__Eina__Stringshare__Group_ga4e3ce40744291c1fb8574e26883c0bf2}{eina\+\_\+stringshare\+\_\+add()}}, and \mbox{\hyperlink{group__Eina__Stringshare__Group_ga5538b4a134987b8a01744fad1a845ba4}{eina\+\_\+stringshare\+\_\+del()}}.

\mbox{\Hypertarget{group__Elua_ga3ef02ac4acf29212793720849391d4b8}\label{group__Elua_ga3ef02ac4acf29212793720849391d4b8}} 
\index{Elua@{Elua}!elua\_state\_dirs\_fill@{elua\_state\_dirs\_fill}}
\index{elua\_state\_dirs\_fill@{elua\_state\_dirs\_fill}!Elua@{Elua}}
\doxysubsubsection{\texorpdfstring{elua\_state\_dirs\_fill()}{elua\_state\_dirs\_fill()}}
{\footnotesize\ttfamily EAPI void elua\+\_\+state\+\_\+dirs\+\_\+fill (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__Elua_ga688a5ca32c81bcaf4811f688c3fec981}{Elua\+\_\+\+State}} $\ast$}]{es,  }\item[{\mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool}}}]{ignore\+\_\+env }\end{DoxyParamCaption})}



Fill the currently unset Elua dirs. 

This checks if any of the three main paths are unset and tries to fill them from the environment. It first tries environment variables to fill them (ELUA\+\_\+\+CORE\+\_\+\+DIR, ELUA\+\_\+\+MODULES\+\_\+\+DIR, ELUA\+\_\+\+APPS\+\_\+\+DIR) unless the ignore\+\_\+env param is EINA\+\_\+\+TRUE. If it is (or if the environment vars weren\textquotesingle{}t set right) it uses eina prefix of the library to determine the paths. In that case they will expand to DATADIR/core, DATADIR/modules and DATADIR/apps, where DATADIR is typically something like /usr/share/elua.

Also, all the paths will be sanitized before setting by calling \mbox{\hyperlink{group__Eina__File__Group_ga4c11cce335038a46c2979f1ecf5f3d33}{eina\+\_\+file\+\_\+path\+\_\+sanitize}} on them.


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em es} & The Elua state. \\
\hline
\mbox{\texttt{ in}}  & {\em ignore\+\_\+env} & If set to EINA\+\_\+\+TRUE, this ignores the env vars. \\
\hline
\end{DoxyParams}


References \mbox{\hyperlink{group__Eina__File__Group_ga4c11cce335038a46c2979f1ecf5f3d33}{eina\+\_\+file\+\_\+path\+\_\+sanitize()}}, \mbox{\hyperlink{group__Eina__Prefix__Group_ga23d85bc49fcbde16b390a14de82d7c05}{eina\+\_\+prefix\+\_\+data\+\_\+get()}}, \mbox{\hyperlink{group__Eina__Safety__Checks__Group_ga1ccf8538d0015b3801ff642e6156843a}{EINA\+\_\+\+SAFETY\+\_\+\+ON\+\_\+\+NULL\+\_\+\+RETURN}}, and \mbox{\hyperlink{group__Eina__Stringshare__Group_ga4e3ce40744291c1fb8574e26883c0bf2}{eina\+\_\+stringshare\+\_\+add()}}.

\mbox{\Hypertarget{group__Elua_ga6a1fd985975cf6cb22441aa419b5bd2d}\label{group__Elua_ga6a1fd985975cf6cb22441aa419b5bd2d}} 
\index{Elua@{Elua}!elua\_state\_core\_dir\_get@{elua\_state\_core\_dir\_get}}
\index{elua\_state\_core\_dir\_get@{elua\_state\_core\_dir\_get}!Elua@{Elua}}
\doxysubsubsection{\texorpdfstring{elua\_state\_core\_dir\_get()}{elua\_state\_core\_dir\_get()}}
{\footnotesize\ttfamily EAPI \mbox{\hyperlink{group__Eina__Stringshare__Group_ga2b7dc19609a55e630a96cc1396e38a53}{Eina\+\_\+\+Stringshare}} $\ast$ elua\+\_\+state\+\_\+core\+\_\+dir\+\_\+get (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{group__Elua_ga688a5ca32c81bcaf4811f688c3fec981}{Elua\+\_\+\+State}} $\ast$}]{es }\end{DoxyParamCaption})}



Retrieve the Elua core dir. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em es} & The Elua state. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The path. 
\end{DoxyReturn}


References \mbox{\hyperlink{group__Eina__Safety__Checks__Group_gab2b07061fc6500dedd9cd41c8d16f95d}{EINA\+\_\+\+SAFETY\+\_\+\+ON\+\_\+\+NULL\+\_\+\+RETURN\+\_\+\+VAL}}.

\mbox{\Hypertarget{group__Elua_ga3dba5ae7f1aaefd681c4e4c219d9cabe}\label{group__Elua_ga3dba5ae7f1aaefd681c4e4c219d9cabe}} 
\index{Elua@{Elua}!elua\_state\_mod\_dir\_get@{elua\_state\_mod\_dir\_get}}
\index{elua\_state\_mod\_dir\_get@{elua\_state\_mod\_dir\_get}!Elua@{Elua}}
\doxysubsubsection{\texorpdfstring{elua\_state\_mod\_dir\_get()}{elua\_state\_mod\_dir\_get()}}
{\footnotesize\ttfamily EAPI \mbox{\hyperlink{group__Eina__Stringshare__Group_ga2b7dc19609a55e630a96cc1396e38a53}{Eina\+\_\+\+Stringshare}} $\ast$ elua\+\_\+state\+\_\+mod\+\_\+dir\+\_\+get (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{group__Elua_ga688a5ca32c81bcaf4811f688c3fec981}{Elua\+\_\+\+State}} $\ast$}]{es }\end{DoxyParamCaption})}



Retrieve the Elua module dir. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em es} & The Elua state. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The path. 
\end{DoxyReturn}


References \mbox{\hyperlink{group__Eina__Safety__Checks__Group_gab2b07061fc6500dedd9cd41c8d16f95d}{EINA\+\_\+\+SAFETY\+\_\+\+ON\+\_\+\+NULL\+\_\+\+RETURN\+\_\+\+VAL}}.

\mbox{\Hypertarget{group__Elua_ga2876193e67462944422bbae57d796bee}\label{group__Elua_ga2876193e67462944422bbae57d796bee}} 
\index{Elua@{Elua}!elua\_state\_apps\_dir\_get@{elua\_state\_apps\_dir\_get}}
\index{elua\_state\_apps\_dir\_get@{elua\_state\_apps\_dir\_get}!Elua@{Elua}}
\doxysubsubsection{\texorpdfstring{elua\_state\_apps\_dir\_get()}{elua\_state\_apps\_dir\_get()}}
{\footnotesize\ttfamily EAPI \mbox{\hyperlink{group__Eina__Stringshare__Group_ga2b7dc19609a55e630a96cc1396e38a53}{Eina\+\_\+\+Stringshare}} $\ast$ elua\+\_\+state\+\_\+apps\+\_\+dir\+\_\+get (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{group__Elua_ga688a5ca32c81bcaf4811f688c3fec981}{Elua\+\_\+\+State}} $\ast$}]{es }\end{DoxyParamCaption})}



Retrieve the Elua apps dir. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em es} & The Elua state. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The path. 
\end{DoxyReturn}


References \mbox{\hyperlink{group__Eina__Safety__Checks__Group_gab2b07061fc6500dedd9cd41c8d16f95d}{EINA\+\_\+\+SAFETY\+\_\+\+ON\+\_\+\+NULL\+\_\+\+RETURN\+\_\+\+VAL}}.

\mbox{\Hypertarget{group__Elua_gad5d34af0d7ad95327b368e1c99614e2b}\label{group__Elua_gad5d34af0d7ad95327b368e1c99614e2b}} 
\index{Elua@{Elua}!elua\_state\_prog\_name\_get@{elua\_state\_prog\_name\_get}}
\index{elua\_state\_prog\_name\_get@{elua\_state\_prog\_name\_get}!Elua@{Elua}}
\doxysubsubsection{\texorpdfstring{elua\_state\_prog\_name\_get()}{elua\_state\_prog\_name\_get()}}
{\footnotesize\ttfamily EAPI \mbox{\hyperlink{group__Eina__Stringshare__Group_ga2b7dc19609a55e630a96cc1396e38a53}{Eina\+\_\+\+Stringshare}} $\ast$ elua\+\_\+state\+\_\+prog\+\_\+name\+\_\+get (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{group__Elua_ga688a5ca32c81bcaf4811f688c3fec981}{Elua\+\_\+\+State}} $\ast$}]{es }\end{DoxyParamCaption})}



Retrieve the prog name set on state creation. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em es} & The Elua state. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The name. 
\end{DoxyReturn}


References \mbox{\hyperlink{group__Eina__Safety__Checks__Group_gab2b07061fc6500dedd9cd41c8d16f95d}{EINA\+\_\+\+SAFETY\+\_\+\+ON\+\_\+\+NULL\+\_\+\+RETURN\+\_\+\+VAL}}.

\mbox{\Hypertarget{group__Elua_ga1c0e7c790bcfb9f0e9b19295d6e953f4}\label{group__Elua_ga1c0e7c790bcfb9f0e9b19295d6e953f4}} 
\index{Elua@{Elua}!elua\_state\_include\_path\_add@{elua\_state\_include\_path\_add}}
\index{elua\_state\_include\_path\_add@{elua\_state\_include\_path\_add}!Elua@{Elua}}
\doxysubsubsection{\texorpdfstring{elua\_state\_include\_path\_add()}{elua\_state\_include\_path\_add()}}
{\footnotesize\ttfamily EAPI void elua\+\_\+state\+\_\+include\+\_\+path\+\_\+add (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__Elua_ga688a5ca32c81bcaf4811f688c3fec981}{Elua\+\_\+\+State}} $\ast$}]{es,  }\item[{const char $\ast$}]{path }\end{DoxyParamCaption})}



Add another path to look up modules in to the state. 

The path will be sanitized using \mbox{\hyperlink{group__Eina__File__Group_ga4c11cce335038a46c2979f1ecf5f3d33}{eina\+\_\+file\+\_\+path\+\_\+sanitize}}.


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em es} & The Elua state. \\
\hline
\end{DoxyParams}


References \mbox{\hyperlink{group__Eina__File__Group_ga4c11cce335038a46c2979f1ecf5f3d33}{eina\+\_\+file\+\_\+path\+\_\+sanitize()}}, \mbox{\hyperlink{group__Eina__List__Group_ga625698a383dda8fc0db245a1c7608c49}{eina\+\_\+list\+\_\+append()}}, \mbox{\hyperlink{group__Eina__Safety__Checks__Group_ga4c65e34fc0099bb68833d44ad02fb724}{EINA\+\_\+\+SAFETY\+\_\+\+ON\+\_\+\+FALSE\+\_\+\+RETURN}}, \mbox{\hyperlink{group__Eina__Safety__Checks__Group_ga1ccf8538d0015b3801ff642e6156843a}{EINA\+\_\+\+SAFETY\+\_\+\+ON\+\_\+\+NULL\+\_\+\+RETURN}}, and \mbox{\hyperlink{group__Eina__Stringshare__Group_ga4e3ce40744291c1fb8574e26883c0bf2}{eina\+\_\+stringshare\+\_\+add()}}.

\mbox{\Hypertarget{group__Elua_gaa25a6712cc9fe309050b90f577ed4721}\label{group__Elua_gaa25a6712cc9fe309050b90f577ed4721}} 
\index{Elua@{Elua}!elua\_state\_require\_ref\_push@{elua\_state\_require\_ref\_push}}
\index{elua\_state\_require\_ref\_push@{elua\_state\_require\_ref\_push}!Elua@{Elua}}
\doxysubsubsection{\texorpdfstring{elua\_state\_require\_ref\_push()}{elua\_state\_require\_ref\_push()}}
{\footnotesize\ttfamily EAPI \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool}} elua\+\_\+state\+\_\+require\+\_\+ref\+\_\+push (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__Elua_ga688a5ca32c81bcaf4811f688c3fec981}{Elua\+\_\+\+State}} $\ast$}]{es }\end{DoxyParamCaption})}



Push the Elua \char`\"{}require\char`\"{} function onto the Lua stack. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em es} & The Elua state. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
EINA\+\_\+\+TRUE if the push was successful, EINA\+\_\+\+FALSE otherwise. 
\end{DoxyReturn}


References \mbox{\hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{EINA\+\_\+\+FALSE}}, \mbox{\hyperlink{group__Eina__Safety__Checks__Group_gae7cf7b1d66fa9022242e09fd53c06bb2}{EINA\+\_\+\+SAFETY\+\_\+\+ON\+\_\+\+FALSE\+\_\+\+RETURN\+\_\+\+VAL}}, \mbox{\hyperlink{group__Eina__Safety__Checks__Group_gab2b07061fc6500dedd9cd41c8d16f95d}{EINA\+\_\+\+SAFETY\+\_\+\+ON\+\_\+\+NULL\+\_\+\+RETURN\+\_\+\+VAL}}, and \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\+\_\+\+TRUE}}.



Referenced by \mbox{\hyperlink{group__Elua_ga0a4d8913fce4bb564a3ae7935e1f29a5}{elua\+\_\+state\+\_\+setup()}}, and \mbox{\hyperlink{group__Elua_gafde1f73d35f2521d3812b72b2c3542c1}{elua\+\_\+util\+\_\+require()}}.

\mbox{\Hypertarget{group__Elua_gaeb1c950c4487106cdb2ed1d915ef4dd4}\label{group__Elua_gaeb1c950c4487106cdb2ed1d915ef4dd4}} 
\index{Elua@{Elua}!elua\_state\_appload\_ref\_push@{elua\_state\_appload\_ref\_push}}
\index{elua\_state\_appload\_ref\_push@{elua\_state\_appload\_ref\_push}!Elua@{Elua}}
\doxysubsubsection{\texorpdfstring{elua\_state\_appload\_ref\_push()}{elua\_state\_appload\_ref\_push()}}
{\footnotesize\ttfamily EAPI \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool}} elua\+\_\+state\+\_\+appload\+\_\+ref\+\_\+push (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__Elua_ga688a5ca32c81bcaf4811f688c3fec981}{Elua\+\_\+\+State}} $\ast$}]{es }\end{DoxyParamCaption})}



Push the Elua app loader function onto the Lua stack. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em es} & The Elua state. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
EINA\+\_\+\+TRUE if the push was successful, EINA\+\_\+\+FALSE otherwise. 
\end{DoxyReturn}


References \mbox{\hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{EINA\+\_\+\+FALSE}}, \mbox{\hyperlink{group__Eina__Safety__Checks__Group_gae7cf7b1d66fa9022242e09fd53c06bb2}{EINA\+\_\+\+SAFETY\+\_\+\+ON\+\_\+\+FALSE\+\_\+\+RETURN\+\_\+\+VAL}}, \mbox{\hyperlink{group__Eina__Safety__Checks__Group_gab2b07061fc6500dedd9cd41c8d16f95d}{EINA\+\_\+\+SAFETY\+\_\+\+ON\+\_\+\+NULL\+\_\+\+RETURN\+\_\+\+VAL}}, and \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\+\_\+\+TRUE}}.



Referenced by \mbox{\hyperlink{group__Elua_ga8804ca091a1310f62cab73d592b55f99}{elua\+\_\+util\+\_\+app\+\_\+load()}}.

\mbox{\Hypertarget{group__Elua_ga86f07252060fe9ab1a2984d68f595d15}\label{group__Elua_ga86f07252060fe9ab1a2984d68f595d15}} 
\index{Elua@{Elua}!elua\_state\_lua\_state\_get@{elua\_state\_lua\_state\_get}}
\index{elua\_state\_lua\_state\_get@{elua\_state\_lua\_state\_get}!Elua@{Elua}}
\doxysubsubsection{\texorpdfstring{elua\_state\_lua\_state\_get()}{elua\_state\_lua\_state\_get()}}
{\footnotesize\ttfamily EAPI lua\+\_\+\+State $\ast$ elua\+\_\+state\+\_\+lua\+\_\+state\+\_\+get (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{group__Elua_ga688a5ca32c81bcaf4811f688c3fec981}{Elua\+\_\+\+State}} $\ast$}]{es }\end{DoxyParamCaption})}



Retrieve the Lua state from an Elua state. 

This function retrieves the Lua state from a valid Elua state. As an Elua state is always initialized, this will return a valid state, unless the given Elua state is NULL, in which case it will also return NULL.


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em es} & The Elua state. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The Lua state or NULL. 
\end{DoxyReturn}


References \mbox{\hyperlink{group__Eina__Safety__Checks__Group_gab2b07061fc6500dedd9cd41c8d16f95d}{EINA\+\_\+\+SAFETY\+\_\+\+ON\+\_\+\+NULL\+\_\+\+RETURN\+\_\+\+VAL}}.

\mbox{\Hypertarget{group__Elua_ga0a4d8913fce4bb564a3ae7935e1f29a5}\label{group__Elua_ga0a4d8913fce4bb564a3ae7935e1f29a5}} 
\index{Elua@{Elua}!elua\_state\_setup@{elua\_state\_setup}}
\index{elua\_state\_setup@{elua\_state\_setup}!Elua@{Elua}}
\doxysubsubsection{\texorpdfstring{elua\_state\_setup()}{elua\_state\_setup()}}
{\footnotesize\ttfamily EAPI \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool}} elua\+\_\+state\+\_\+setup (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__Elua_ga688a5ca32c81bcaf4811f688c3fec981}{Elua\+\_\+\+State}} $\ast$}]{es }\end{DoxyParamCaption})}



Set up the Elua state. 

This API function sets up 3 things, module system, i18n and I/O. After that it requires all modules not yet required (i.\+e. those queued in before the state was fully initialized).

This function sets up correct i18n for an Elua state. That means loading the gettext bindings and making Lua aware of them. This also works when i18n support is disabled at compilation time, so you can just call it unconditionally.

This also loads the Elua module system and makes Lua aware of it. It also registers the Elua C utility library module.

Finally, Elua provides its own loadfile based around mmap to replace the less efficient Lua version. This function takes care of the setup.


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em es} & The Elua state. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
EINA\+\_\+\+TRUE on success, EINA\+\_\+\+FALSE on failure. 
\end{DoxyReturn}


References \mbox{\hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{EINA\+\_\+\+FALSE}}, \mbox{\hyperlink{group__Eina__List__Group_gae27a2c686a0a11693f9b06957c9bba83}{EINA\+\_\+\+LIST\+\_\+\+FREE}}, \mbox{\hyperlink{group__Eina__Stringshare__Group_ga5538b4a134987b8a01744fad1a845ba4}{eina\+\_\+stringshare\+\_\+del()}}, \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\+\_\+\+TRUE}}, \mbox{\hyperlink{group__Elua_gaa25a6712cc9fe309050b90f577ed4721}{elua\+\_\+state\+\_\+require\+\_\+ref\+\_\+push()}}, and \mbox{\hyperlink{group__Elua_ga9c5bed4721ba3cc5b8778c59b0c98886}{elua\+\_\+util\+\_\+error\+\_\+report()}}.

\mbox{\Hypertarget{group__Elua_gaaf5c1391a7660da2bb633e15dbeb8b68}\label{group__Elua_gaaf5c1391a7660da2bb633e15dbeb8b68}} 
\index{Elua@{Elua}!elua\_io\_loadfile@{elua\_io\_loadfile}}
\index{elua\_io\_loadfile@{elua\_io\_loadfile}!Elua@{Elua}}
\doxysubsubsection{\texorpdfstring{elua\_io\_loadfile()}{elua\_io\_loadfile()}}
{\footnotesize\ttfamily EAPI int elua\+\_\+io\+\_\+loadfile (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{group__Elua_ga688a5ca32c81bcaf4811f688c3fec981}{Elua\+\_\+\+State}} $\ast$}]{es,  }\item[{const char $\ast$}]{fname }\end{DoxyParamCaption})}



Loads a file using Elua\textquotesingle{}s own mmap-\/based IO. 

This function behaves identically to lua\+L\+\_\+loadfile when it comes to semantics. The loaded file remains on the Lua stack. If the input state is NULL, the return value is -\/1 and nothing is left on the stack. On any different error, the error object is left on the stack and this returns a value larger than zero (LUA\+\_\+\+ERR$\ast$). On success, zero is returned.


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em es} & The Elua state. \\
\hline
\mbox{\texttt{ in}}  & {\em fname} & The file name. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 for no errors, a non-\/zero value for errors (-\/1 for NULL es). 
\end{DoxyReturn}


References \mbox{\hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{EINA\+\_\+\+FALSE}}, \mbox{\hyperlink{group__Eina__File__Group_ga6b19a0682a3747cb5c313dc7d0e41a90}{eina\+\_\+file\+\_\+close()}}, \mbox{\hyperlink{group__Eina__File__Group_gaae165c21af09fca39c2d1f89a92cb6b1}{eina\+\_\+file\+\_\+map\+\_\+all()}}, \mbox{\hyperlink{group__Eina__File__Group_gaf52b237fec73dbbcd411c8f999c5b5df}{eina\+\_\+file\+\_\+map\+\_\+free()}}, \mbox{\hyperlink{group__Eina__File__Group_gga2788825dfdd797282112148f2f65ec7aae9b963a3ffd3a5f885c86db4673eabd3}{EINA\+\_\+\+FILE\+\_\+\+RANDOM}}, \mbox{\hyperlink{group__Eina__File__Group_ga2f57057d1d66e6392a832674a69c1278}{eina\+\_\+file\+\_\+size\+\_\+get()}}, and \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\+\_\+\+TRUE}}.



Referenced by \mbox{\hyperlink{group__Elua_ga7a9f852864e3e14dc517fa23ad1167c5}{elua\+\_\+util\+\_\+file\+\_\+run()}}, and \mbox{\hyperlink{group__Elua_ga003f5ca8e27d1249f6531318edb65456}{elua\+\_\+util\+\_\+script\+\_\+run()}}.

\mbox{\Hypertarget{group__Elua_gafde1f73d35f2521d3812b72b2c3542c1}\label{group__Elua_gafde1f73d35f2521d3812b72b2c3542c1}} 
\index{Elua@{Elua}!elua\_util\_require@{elua\_util\_require}}
\index{elua\_util\_require@{elua\_util\_require}!Elua@{Elua}}
\doxysubsubsection{\texorpdfstring{elua\_util\_require()}{elua\_util\_require()}}
{\footnotesize\ttfamily EAPI \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool}} elua\+\_\+util\+\_\+require (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__Elua_ga688a5ca32c81bcaf4811f688c3fec981}{Elua\+\_\+\+State}} $\ast$}]{es,  }\item[{const char $\ast$}]{libname }\end{DoxyParamCaption})}



Requires a module. 

Requires a Lua module. Leaves the Lua stack clean.


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em es} & The Elua state. \\
\hline
\mbox{\texttt{ in}}  & {\em libname} & The library name. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
EINA\+\_\+\+TRUE on success, EINA\+\_\+\+FALSE on failure. 
\end{DoxyReturn}


References \mbox{\hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{EINA\+\_\+\+FALSE}}, \mbox{\hyperlink{group__Eina__List__Group_ga625698a383dda8fc0db245a1c7608c49}{eina\+\_\+list\+\_\+append()}}, \mbox{\hyperlink{group__Eina__Safety__Checks__Group_gab2b07061fc6500dedd9cd41c8d16f95d}{EINA\+\_\+\+SAFETY\+\_\+\+ON\+\_\+\+NULL\+\_\+\+RETURN\+\_\+\+VAL}}, \mbox{\hyperlink{group__Eina__Stringshare__Group_ga4e3ce40744291c1fb8574e26883c0bf2}{eina\+\_\+stringshare\+\_\+add()}}, \mbox{\hyperlink{group__Elua_gaa25a6712cc9fe309050b90f577ed4721}{elua\+\_\+state\+\_\+require\+\_\+ref\+\_\+push()}}, and \mbox{\hyperlink{group__Elua_ga9c5bed4721ba3cc5b8778c59b0c98886}{elua\+\_\+util\+\_\+error\+\_\+report()}}.

\mbox{\Hypertarget{group__Elua_ga7a9f852864e3e14dc517fa23ad1167c5}\label{group__Elua_ga7a9f852864e3e14dc517fa23ad1167c5}} 
\index{Elua@{Elua}!elua\_util\_file\_run@{elua\_util\_file\_run}}
\index{elua\_util\_file\_run@{elua\_util\_file\_run}!Elua@{Elua}}
\doxysubsubsection{\texorpdfstring{elua\_util\_file\_run()}{elua\_util\_file\_run()}}
{\footnotesize\ttfamily EAPI \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool}} elua\+\_\+util\+\_\+file\+\_\+run (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__Elua_ga688a5ca32c81bcaf4811f688c3fec981}{Elua\+\_\+\+State}} $\ast$}]{es,  }\item[{const char $\ast$}]{fname }\end{DoxyParamCaption})}



Runs a file. 

Runs a file. Uses the Elua mmapped file IO to load the file.


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em es} & The Elua state. \\
\hline
\mbox{\texttt{ in}}  & {\em fname} & The file name. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
EINA\+\_\+\+TRUE on success, EINA\+\_\+\+FALSE on failure. 
\end{DoxyReturn}


References \mbox{\hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{EINA\+\_\+\+FALSE}}, \mbox{\hyperlink{group__Eina__Safety__Checks__Group_gab2b07061fc6500dedd9cd41c8d16f95d}{EINA\+\_\+\+SAFETY\+\_\+\+ON\+\_\+\+NULL\+\_\+\+RETURN\+\_\+\+VAL}}, \mbox{\hyperlink{group__Elua_gaaf5c1391a7660da2bb633e15dbeb8b68}{elua\+\_\+io\+\_\+loadfile()}}, and \mbox{\hyperlink{group__Elua_ga9c5bed4721ba3cc5b8778c59b0c98886}{elua\+\_\+util\+\_\+error\+\_\+report()}}.

\mbox{\Hypertarget{group__Elua_ga7936ab36149c7572cc756fe5db6bf91d}\label{group__Elua_ga7936ab36149c7572cc756fe5db6bf91d}} 
\index{Elua@{Elua}!elua\_util\_string\_run@{elua\_util\_string\_run}}
\index{elua\_util\_string\_run@{elua\_util\_string\_run}!Elua@{Elua}}
\doxysubsubsection{\texorpdfstring{elua\_util\_string\_run()}{elua\_util\_string\_run()}}
{\footnotesize\ttfamily EAPI \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool}} elua\+\_\+util\+\_\+string\+\_\+run (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__Elua_ga688a5ca32c81bcaf4811f688c3fec981}{Elua\+\_\+\+State}} $\ast$}]{es,  }\item[{const char $\ast$}]{chunk,  }\item[{const char $\ast$}]{chname }\end{DoxyParamCaption})}



Runs a string. 

Runs a string.


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em es} & The Elua state. \\
\hline
\mbox{\texttt{ in}}  & {\em chunk} & The string to run. \\
\hline
\mbox{\texttt{ in}}  & {\em chname} & The chunk name to use for traceback/debug. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
EINA\+\_\+\+TRUE on success, EINA\+\_\+\+FALSE on failure. 
\end{DoxyReturn}


References \mbox{\hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{EINA\+\_\+\+FALSE}}, \mbox{\hyperlink{group__Eina__Safety__Checks__Group_gab2b07061fc6500dedd9cd41c8d16f95d}{EINA\+\_\+\+SAFETY\+\_\+\+ON\+\_\+\+NULL\+\_\+\+RETURN\+\_\+\+VAL}}, and \mbox{\hyperlink{group__Elua_ga9c5bed4721ba3cc5b8778c59b0c98886}{elua\+\_\+util\+\_\+error\+\_\+report()}}.

\mbox{\Hypertarget{group__Elua_ga8804ca091a1310f62cab73d592b55f99}\label{group__Elua_ga8804ca091a1310f62cab73d592b55f99}} 
\index{Elua@{Elua}!elua\_util\_app\_load@{elua\_util\_app\_load}}
\index{elua\_util\_app\_load@{elua\_util\_app\_load}!Elua@{Elua}}
\doxysubsubsection{\texorpdfstring{elua\_util\_app\_load()}{elua\_util\_app\_load()}}
{\footnotesize\ttfamily EAPI int elua\+\_\+util\+\_\+app\+\_\+load (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__Elua_ga688a5ca32c81bcaf4811f688c3fec981}{Elua\+\_\+\+State}} $\ast$}]{es,  }\item[{const char $\ast$}]{appname }\end{DoxyParamCaption})}



Loads an application. 

This loads an app, respecting the app path set on state initialization. Actually runs the app. If the input state is NULL, the return value is -\/1 nd nothing is left on the stack. On any different error, the error object is left on the stack and this returns 1. On success, zero is returned (and the return value from the app is left on the stack).


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em es} & The Elua state. \\
\hline
\mbox{\texttt{ in}}  & {\em appname} & The application name. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 for no errors, 1 on errors, -\/1 on null input. 
\end{DoxyReturn}


References \mbox{\hyperlink{group__Eina__Safety__Checks__Group_gae7cf7b1d66fa9022242e09fd53c06bb2}{EINA\+\_\+\+SAFETY\+\_\+\+ON\+\_\+\+FALSE\+\_\+\+RETURN\+\_\+\+VAL}}, \mbox{\hyperlink{group__Eina__Safety__Checks__Group_gab2b07061fc6500dedd9cd41c8d16f95d}{EINA\+\_\+\+SAFETY\+\_\+\+ON\+\_\+\+NULL\+\_\+\+RETURN\+\_\+\+VAL}}, and \mbox{\hyperlink{group__Elua_gaeb1c950c4487106cdb2ed1d915ef4dd4}{elua\+\_\+state\+\_\+appload\+\_\+ref\+\_\+push()}}.



Referenced by \mbox{\hyperlink{group__Elua_ga003f5ca8e27d1249f6531318edb65456}{elua\+\_\+util\+\_\+script\+\_\+run()}}.

\mbox{\Hypertarget{group__Elua_ga003f5ca8e27d1249f6531318edb65456}\label{group__Elua_ga003f5ca8e27d1249f6531318edb65456}} 
\index{Elua@{Elua}!elua\_util\_script\_run@{elua\_util\_script\_run}}
\index{elua\_util\_script\_run@{elua\_util\_script\_run}!Elua@{Elua}}
\doxysubsubsection{\texorpdfstring{elua\_util\_script\_run()}{elua\_util\_script\_run()}}
{\footnotesize\ttfamily EAPI \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool}} elua\+\_\+util\+\_\+script\+\_\+run (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__Elua_ga688a5ca32c81bcaf4811f688c3fec981}{Elua\+\_\+\+State}} $\ast$}]{es,  }\item[{int}]{argc,  }\item[{char $\ast$$\ast$}]{argv,  }\item[{int}]{n,  }\item[{int $\ast$}]{quit }\end{DoxyParamCaption})}



Runs a script. 

This is a more complicated function that runs a script. It\textquotesingle{}s a combination of the previously mentioned util functions. It takes argc and argv, which are typically given to the program, and an index of the first positional arg in argv (i.\+e. not options). The value on this index is then used as the potential name.

If this name is either a dash or empty, the script is loaded from stdin. If it\textquotesingle{}s a value and a file with this name exists, the script is loaded from the file. Otherwise, the name is treated to be an application name, and is loaded from the application path.

If all succeeds, this is then run, and a quit value is written into the quit arg; if it\textquotesingle{}s true (1), it means the app wants to exit immediately. If it\textquotesingle{}s false (0), it means the app likely wants to execute a main loop.


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em es} & The Elua state. \\
\hline
\mbox{\texttt{ in}}  & {\em argc} & The argument count. \\
\hline
\mbox{\texttt{ in}}  & {\em argv} & The arguments. \\
\hline
\mbox{\texttt{ in}}  & {\em n} & The index of the first positional argt. \\
\hline
\mbox{\texttt{ out}}  & {\em quit} & Whether to quit or run a main loop. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
EINA\+\_\+\+TRUE on success, EINA\+\_\+\+FALSE on failure. 
\end{DoxyReturn}


References \mbox{\hyperlink{group__Eina__Safety__Checks__Group_gae7cf7b1d66fa9022242e09fd53c06bb2}{EINA\+\_\+\+SAFETY\+\_\+\+ON\+\_\+\+FALSE\+\_\+\+RETURN\+\_\+\+VAL}}, \mbox{\hyperlink{group__Eina__Safety__Checks__Group_gab2b07061fc6500dedd9cd41c8d16f95d}{EINA\+\_\+\+SAFETY\+\_\+\+ON\+\_\+\+NULL\+\_\+\+RETURN\+\_\+\+VAL}}, \mbox{\hyperlink{group__Elua_gaaf5c1391a7660da2bb633e15dbeb8b68}{elua\+\_\+io\+\_\+loadfile()}}, \mbox{\hyperlink{group__Elua_ga8804ca091a1310f62cab73d592b55f99}{elua\+\_\+util\+\_\+app\+\_\+load()}}, and \mbox{\hyperlink{group__Elua_ga9c5bed4721ba3cc5b8778c59b0c98886}{elua\+\_\+util\+\_\+error\+\_\+report()}}.

\mbox{\Hypertarget{group__Elua_ga9c5bed4721ba3cc5b8778c59b0c98886}\label{group__Elua_ga9c5bed4721ba3cc5b8778c59b0c98886}} 
\index{Elua@{Elua}!elua\_util\_error\_report@{elua\_util\_error\_report}}
\index{elua\_util\_error\_report@{elua\_util\_error\_report}!Elua@{Elua}}
\doxysubsubsection{\texorpdfstring{elua\_util\_error\_report()}{elua\_util\_error\_report()}}
{\footnotesize\ttfamily EAPI int elua\+\_\+util\+\_\+error\+\_\+report (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{group__Elua_ga688a5ca32c81bcaf4811f688c3fec981}{Elua\+\_\+\+State}} $\ast$}]{es,  }\item[{int}]{status }\end{DoxyParamCaption})}



Reports an error using Eina logging. 

If the given status is 0, this function just returns it. Otherwise, it takes the topmost item on the Lua stack, converts it to string (if it cannot be converted, a \char`\"{}(non-\/string error)\char`\"{} placeholder is used) and logs it out as an error, together with the program name set on Elua state init.


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em es} & The Elua state. \\
\hline
\mbox{\texttt{ in}}  & {\em status} & The status code. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The status code. 
\end{DoxyReturn}


References \mbox{\hyperlink{group__Eina__Safety__Checks__Group_gae7cf7b1d66fa9022242e09fd53c06bb2}{EINA\+\_\+\+SAFETY\+\_\+\+ON\+\_\+\+FALSE\+\_\+\+RETURN\+\_\+\+VAL}}.



Referenced by \mbox{\hyperlink{group__Elua_ga0a4d8913fce4bb564a3ae7935e1f29a5}{elua\+\_\+state\+\_\+setup()}}, \mbox{\hyperlink{group__Elua_ga7a9f852864e3e14dc517fa23ad1167c5}{elua\+\_\+util\+\_\+file\+\_\+run()}}, \mbox{\hyperlink{group__Elua_gafde1f73d35f2521d3812b72b2c3542c1}{elua\+\_\+util\+\_\+require()}}, \mbox{\hyperlink{group__Elua_ga003f5ca8e27d1249f6531318edb65456}{elua\+\_\+util\+\_\+script\+\_\+run()}}, and \mbox{\hyperlink{group__Elua_ga7936ab36149c7572cc756fe5db6bf91d}{elua\+\_\+util\+\_\+string\+\_\+run()}}.

