\hypertarget{group__Evil__Stdlib__Group}{}\section{Stdlib.\+h functions.}
\label{group__Evil__Stdlib__Group}\index{Stdlib.\+h functions.@{Stdlib.\+h functions.}}


This header provides functions ported from Unix in stdlib.\+h.  


\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
int \hyperlink{group__Evil__Stdlib__Group_ga1c8b16a3abcb4dc450a0a62b42c554dd}{setenv} (const char $\ast$name, const char $\ast$value, int overwrite)
\begin{DoxyCompactList}\small\item\em Create, modify, or remove environment variables. \end{DoxyCompactList}\item 
int \hyperlink{group__Evil__Stdlib__Group_ga17a3a11d20a551951a4acbc3872b280c}{unsetenv} (const char $\ast$name)
\begin{DoxyCompactList}\small\item\em Remove environment variables. \end{DoxyCompactList}\item 
int \hyperlink{group__Evil__Stdlib__Group_gab62e7adedbeaf115d479d057e1c7b795}{mkstemp} (char $\ast$\+\_\+\+\_\+template)
\begin{DoxyCompactList}\small\item\em Create a unique temporary file name. \end{DoxyCompactList}\item 
char $\ast$ \hyperlink{group__Evil__Stdlib__Group_ga1251526bfc32a1b8a5263bfa352254e2}{mkdtemp} (char $\ast$\+\_\+\+\_\+template)
\begin{DoxyCompactList}\small\item\em create an unique temporary directory \end{DoxyCompactList}\item 
int \hyperlink{group__Evil__Stdlib__Group_ga3cd3b72ac138782cad52c08cd4bdfc86}{mkstemps} (char $\ast$\+\_\+\+\_\+template, int suffixlen)
\begin{DoxyCompactList}\small\item\em Create a unique temporary file name with a suffix. \end{DoxyCompactList}\item 
char $\ast$ \hyperlink{group__Evil__Stdlib__Group_gafefd37e884231d4b4efe6a3edfdd53d9}{realpath} (const char $\ast$file\+\_\+name, char $\ast$resolved\+\_\+name)
\begin{DoxyCompactList}\small\item\em Return an absolute or full path name for a specified relative path name. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
This header provides functions ported from Unix in stdlib.\+h. 



\subsection{Function Documentation}
\hypertarget{group__Evil__Stdlib__Group_ga1c8b16a3abcb4dc450a0a62b42c554dd}{}\index{Stdlib.\+h functions.@{Stdlib.\+h functions.}!setenv@{setenv}}
\index{setenv@{setenv}!Stdlib.\+h functions.@{Stdlib.\+h functions.}}
\subsubsection[{setenv}]{\setlength{\rightskip}{0pt plus 5cm}int setenv (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{name, }
\item[{const char $\ast$}]{value, }
\item[{int}]{overwrite}
\end{DoxyParamCaption}
)}\label{group__Evil__Stdlib__Group_ga1c8b16a3abcb4dc450a0a62b42c554dd}


Create, modify, or remove environment variables. 


\begin{DoxyParams}{Parameters}
{\em name} & The name of the environment variable. \\
\hline
{\em value} & The value of the environment variable to set. \\
\hline
{\em overwrite} & 0 to let the environment variable unchanged, 1 otherwise. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 on success, -\/1 otherwise.
\end{DoxyReturn}
Add the new environment variable {\ttfamily name} or modify its value if it exists, and set it to {\ttfamily value}. Environment variables define the environment in which a process executes. If {\ttfamily value} is {\ttfamily N\+U\+L\+L}, the variable is removed (unset) and that call is equivalent to \hyperlink{group__Evil__Stdlib__Group_ga17a3a11d20a551951a4acbc3872b280c}{unsetenv()}.If the environment variable named by {\ttfamily name} already exists and the value of {\ttfamily overwrite} is 0, the function shall return success and the environment shall remain unchanged. If the function succeeds, it returns 0, otherwise it returns -\/1.

Conformity\+: Non applicable.

Supported O\+S\+: Windows X\+P. 

Referenced by ecore\+\_\+drm\+\_\+tty\+\_\+open(), and unsetenv().

\hypertarget{group__Evil__Stdlib__Group_ga17a3a11d20a551951a4acbc3872b280c}{}\index{Stdlib.\+h functions.@{Stdlib.\+h functions.}!unsetenv@{unsetenv}}
\index{unsetenv@{unsetenv}!Stdlib.\+h functions.@{Stdlib.\+h functions.}}
\subsubsection[{unsetenv}]{\setlength{\rightskip}{0pt plus 5cm}int unsetenv (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{name}
\end{DoxyParamCaption}
)}\label{group__Evil__Stdlib__Group_ga17a3a11d20a551951a4acbc3872b280c}


Remove environment variables. 


\begin{DoxyParams}{Parameters}
{\em name} & The name of the environment variable. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 on success, -\/1 otherwise.
\end{DoxyReturn}
Remove the new environment variable {\ttfamily name} if it exists. That function is equivalent to \hyperlink{group__Evil__Stdlib__Group_ga1c8b16a3abcb4dc450a0a62b42c554dd}{setenv()} with its second parameter to {\ttfamily N\+U\+L\+L} and the third to 1. If the function succeeds, it returns 0, otherwise it returns -\/1.

Conformity\+: Non applicable.

Supported O\+S\+: Windows X\+P. 

References setenv().



Referenced by ecore\+\_\+drm\+\_\+tty\+\_\+close(), ecore\+\_\+fork\+\_\+reset(), and ecore\+\_\+init().

\hypertarget{group__Evil__Stdlib__Group_gab62e7adedbeaf115d479d057e1c7b795}{}\index{Stdlib.\+h functions.@{Stdlib.\+h functions.}!mkstemp@{mkstemp}}
\index{mkstemp@{mkstemp}!Stdlib.\+h functions.@{Stdlib.\+h functions.}}
\subsubsection[{mkstemp}]{\setlength{\rightskip}{0pt plus 5cm}int mkstemp (
\begin{DoxyParamCaption}
\item[{char $\ast$}]{\+\_\+\+\_\+template}
\end{DoxyParamCaption}
)}\label{group__Evil__Stdlib__Group_gab62e7adedbeaf115d479d057e1c7b795}


Create a unique temporary file name. 


\begin{DoxyParams}{Parameters}
{\em \+\_\+\+\_\+template} & Template of the file to create. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
A file descriptor on success, -\/1 otherwise.
\end{DoxyReturn}
Take the given file name {\ttfamily template} and overwrite a portion of it to create a file name. This file is guaranted not to exist at the time invocation and is suitable for use by the function.

The {\ttfamily template} parameter can be any file name with six X\textquotesingle{}s at the end for example {\itshape base\+X\+X\+X\+X\+X\+X}, where {\itshape base} is the part of the new file that you supply and each \textquotesingle{}X\textquotesingle{} is a placeholder for a character supplied by \hyperlink{group__Evil__Stdlib__Group_gab62e7adedbeaf115d479d057e1c7b795}{mkstemp()}. The trailing \textquotesingle{}Xs\textquotesingle{} are replaced with a six-\/digit value; this value is a unique number. Each successful call to \hyperlink{group__Evil__Stdlib__Group_gab62e7adedbeaf115d479d057e1c7b795}{mkstemp()} modifies {\ttfamily template}.

When \hyperlink{group__Evil__Stdlib__Group_gab62e7adedbeaf115d479d057e1c7b795}{mkstemp()} succeeds, it creates and opens the temporary file for reading and writing.

On success, the function returns the file descriptor of the temporary file. Otherwise, it returns -\/1 and errno is set to the following values\+:
\begin{DoxyItemize}
\item E\+I\+N\+V\+A\+L\+: {\ttfamily template} has an invalid format.
\item E\+E\+X\+I\+S\+T\+S\+: File name already exists.
\end{DoxyItemize}

Conformity\+: Should follow B\+S\+D conformity.

Supported O\+S\+: Windows X\+P. 

References mkstemps().



Referenced by ecore\+\_\+file\+\_\+mv(), and eina\+\_\+file\+\_\+mkstemp().

\hypertarget{group__Evil__Stdlib__Group_ga1251526bfc32a1b8a5263bfa352254e2}{}\index{Stdlib.\+h functions.@{Stdlib.\+h functions.}!mkdtemp@{mkdtemp}}
\index{mkdtemp@{mkdtemp}!Stdlib.\+h functions.@{Stdlib.\+h functions.}}
\subsubsection[{mkdtemp}]{\setlength{\rightskip}{0pt plus 5cm}char$\ast$ mkdtemp (
\begin{DoxyParamCaption}
\item[{char $\ast$}]{\+\_\+\+\_\+template}
\end{DoxyParamCaption}
)}\label{group__Evil__Stdlib__Group_ga1251526bfc32a1b8a5263bfa352254e2}


create an unique temporary directory 

\begin{DoxySince}{Since}
1.\+8.\+0 
\end{DoxySince}


Referenced by eina\+\_\+file\+\_\+mkdtemp().

\hypertarget{group__Evil__Stdlib__Group_ga3cd3b72ac138782cad52c08cd4bdfc86}{}\index{Stdlib.\+h functions.@{Stdlib.\+h functions.}!mkstemps@{mkstemps}}
\index{mkstemps@{mkstemps}!Stdlib.\+h functions.@{Stdlib.\+h functions.}}
\subsubsection[{mkstemps}]{\setlength{\rightskip}{0pt plus 5cm}int mkstemps (
\begin{DoxyParamCaption}
\item[{char $\ast$}]{\+\_\+\+\_\+template, }
\item[{int}]{suffixlen}
\end{DoxyParamCaption}
)}\label{group__Evil__Stdlib__Group_ga3cd3b72ac138782cad52c08cd4bdfc86}


Create a unique temporary file name with a suffix. 


\begin{DoxyParams}{Parameters}
{\em \+\_\+\+\_\+template} & Template of the file to create. \\
\hline
{\em suffixlen} & Length of the suffix following the \textquotesingle{}X\+X\+X\+X\+X\+X\textquotesingle{} placeholder. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
A file descriptor on success, -\/1 otherwise.
\end{DoxyReturn}
\begin{DoxySince}{Since}
1.\+10.\+0 
\end{DoxySince}


Referenced by eina\+\_\+file\+\_\+mkstemp(), and mkstemp().

\hypertarget{group__Evil__Stdlib__Group_gafefd37e884231d4b4efe6a3edfdd53d9}{}\index{Stdlib.\+h functions.@{Stdlib.\+h functions.}!realpath@{realpath}}
\index{realpath@{realpath}!Stdlib.\+h functions.@{Stdlib.\+h functions.}}
\subsubsection[{realpath}]{\setlength{\rightskip}{0pt plus 5cm}char$\ast$ realpath (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{file\+\_\+name, }
\item[{char $\ast$}]{resolved\+\_\+name}
\end{DoxyParamCaption}
)}\label{group__Evil__Stdlib__Group_gafefd37e884231d4b4efe6a3edfdd53d9}


Return an absolute or full path name for a specified relative path name. 


\begin{DoxyParams}{Parameters}
{\em file\+\_\+name} & The absolute path name. \\
\hline
{\em resolved\+\_\+name} & The relative path name. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
{\ttfamily N\+U\+L\+L} on failure, a pointer to the absolute path name otherwise.
\end{DoxyReturn}
The function expands the relative path name {\ttfamily file\+\_\+name} to its fully qualified or absolute path and store it in the buffer pointed by {\ttfamily resolved\+\_\+name}. The buffer is at most {\ttfamily P\+A\+T\+H\+\_\+\+M\+A\+X} bytes long. If {\ttfamily resolved\+\_\+name} is {\ttfamily N\+U\+L\+L}, malloc() is used to allocate a buffer of sufficient length to hold the path name. In that case, it is the responsability of the caller to free this buffer with free().

That function can be used to obtain the absolute path name for relative paths (rel\+Path) that include \char`\"{}./\char`\"{} or \char`\"{}../\char`\"{} in their names.

On Windows X\+P, errno is set in the following cases\+:

\begin{DoxyItemize}
\item E\+A\+C\+C\+E\+S\+S\+: if {\ttfamily file\+\_\+name} can not be accessed. \item E\+I\+N\+V\+A\+L\+: if {\ttfamily file\+\_\+name} is {\ttfamily N\+U\+L\+L}. \item E\+N\+A\+M\+E\+T\+O\+O\+L\+O\+N\+G\+: if the path name is too long. \item E\+N\+O\+E\+N\+T\+: {\ttfamily file\+\_\+name} does not exist \item E\+N\+O\+M\+E\+M\+: if memory allocation fails.\end{DoxyItemize}
Conformity\+: None.

Supported O\+S\+: Windows X\+P. 