\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 \mbox{\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 \mbox{\hyperlink{group__Evil__Stdlib__Group_ga17a3a11d20a551951a4acbc3872b280c}{unsetenv}} (const char $\ast$name)
\begin{DoxyCompactList}\small\item\em Remove environment variables. \end{DoxyCompactList}\item 
int \mbox{\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$ \mbox{\hyperlink{group__Evil__Stdlib__Group_ga1251526bfc32a1b8a5263bfa352254e2}{mkdtemp}} (char $\ast$\+\_\+\+\_\+template)
\begin{DoxyCompactList}\small\item\em create an unique temporary directory \end{DoxyCompactList}\item 
int \mbox{\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$ \mbox{\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}
\mbox{\Hypertarget{group__Evil__Stdlib__Group_ga1c8b16a3abcb4dc450a0a62b42c554dd}\label{group__Evil__Stdlib__Group_ga1c8b16a3abcb4dc450a0a62b42c554dd}} 
\index{Stdlib.\+h functions.@{Stdlib.\+h functions.}!setenv@{setenv}}
\index{setenv@{setenv}!Stdlib.\+h functions.@{Stdlib.\+h functions.}}
\subsubsection{\texorpdfstring{setenv()}{setenv()}}
{\footnotesize\ttfamily int setenv (\begin{DoxyParamCaption}\item[{const char $\ast$}]{name,  }\item[{const char $\ast$}]{value,  }\item[{int}]{overwrite }\end{DoxyParamCaption})}



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\+LL}, the variable is removed (unset) and that call is equivalent to \mbox{\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 OS\+: Windows XP. 

Referenced by ecore\+\_\+wl2\+\_\+display\+\_\+create(), and unsetenv().

\mbox{\Hypertarget{group__Evil__Stdlib__Group_ga17a3a11d20a551951a4acbc3872b280c}\label{group__Evil__Stdlib__Group_ga17a3a11d20a551951a4acbc3872b280c}} 
\index{Stdlib.\+h functions.@{Stdlib.\+h functions.}!unsetenv@{unsetenv}}
\index{unsetenv@{unsetenv}!Stdlib.\+h functions.@{Stdlib.\+h functions.}}
\subsubsection{\texorpdfstring{unsetenv()}{unsetenv()}}
{\footnotesize\ttfamily int unsetenv (\begin{DoxyParamCaption}\item[{const char $\ast$}]{name }\end{DoxyParamCaption})}



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 \mbox{\hyperlink{group__Evil__Stdlib__Group_ga1c8b16a3abcb4dc450a0a62b42c554dd}{setenv()}} with its second parameter to {\ttfamily N\+U\+LL} and the third to 1. If the function succeeds, it returns 0, otherwise it returns -\/1.

Conformity\+: Non applicable.

Supported OS\+: Windows XP. 

References setenv().



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

\mbox{\Hypertarget{group__Evil__Stdlib__Group_gab62e7adedbeaf115d479d057e1c7b795}\label{group__Evil__Stdlib__Group_gab62e7adedbeaf115d479d057e1c7b795}} 
\index{Stdlib.\+h functions.@{Stdlib.\+h functions.}!mkstemp@{mkstemp}}
\index{mkstemp@{mkstemp}!Stdlib.\+h functions.@{Stdlib.\+h functions.}}
\subsubsection{\texorpdfstring{mkstemp()}{mkstemp()}}
{\footnotesize\ttfamily int mkstemp (\begin{DoxyParamCaption}\item[{char $\ast$}]{\+\_\+\+\_\+template }\end{DoxyParamCaption})}



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\+XX}, 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 \mbox{\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 \mbox{\hyperlink{group__Evil__Stdlib__Group_gab62e7adedbeaf115d479d057e1c7b795}{mkstemp()}} modifies {\ttfamily template}.

When \mbox{\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\+AL\+: {\ttfamily template} has an invalid format.
\item E\+E\+X\+I\+S\+TS\+: File name already exists.
\end{DoxyItemize}

Conformity\+: Should follow B\+SD conformity.

Supported OS\+: Windows XP. 

References mkstemps().

\mbox{\Hypertarget{group__Evil__Stdlib__Group_ga1251526bfc32a1b8a5263bfa352254e2}\label{group__Evil__Stdlib__Group_ga1251526bfc32a1b8a5263bfa352254e2}} 
\index{Stdlib.\+h functions.@{Stdlib.\+h functions.}!mkdtemp@{mkdtemp}}
\index{mkdtemp@{mkdtemp}!Stdlib.\+h functions.@{Stdlib.\+h functions.}}
\subsubsection{\texorpdfstring{mkdtemp()}{mkdtemp()}}
{\footnotesize\ttfamily char$\ast$ mkdtemp (\begin{DoxyParamCaption}\item[{char $\ast$}]{\+\_\+\+\_\+template }\end{DoxyParamCaption})}



create an unique temporary directory 

\begin{DoxySince}{Since}
1.\+8.\+0 
\end{DoxySince}
\mbox{\Hypertarget{group__Evil__Stdlib__Group_ga3cd3b72ac138782cad52c08cd4bdfc86}\label{group__Evil__Stdlib__Group_ga3cd3b72ac138782cad52c08cd4bdfc86}} 
\index{Stdlib.\+h functions.@{Stdlib.\+h functions.}!mkstemps@{mkstemps}}
\index{mkstemps@{mkstemps}!Stdlib.\+h functions.@{Stdlib.\+h functions.}}
\subsubsection{\texorpdfstring{mkstemps()}{mkstemps()}}
{\footnotesize\ttfamily int mkstemps (\begin{DoxyParamCaption}\item[{char $\ast$}]{\+\_\+\+\_\+template,  }\item[{int}]{suffixlen }\end{DoxyParamCaption})}



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\+XX\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 mkstemp().

\mbox{\Hypertarget{group__Evil__Stdlib__Group_gafefd37e884231d4b4efe6a3edfdd53d9}\label{group__Evil__Stdlib__Group_gafefd37e884231d4b4efe6a3edfdd53d9}} 
\index{Stdlib.\+h functions.@{Stdlib.\+h functions.}!realpath@{realpath}}
\index{realpath@{realpath}!Stdlib.\+h functions.@{Stdlib.\+h functions.}}
\subsubsection{\texorpdfstring{realpath()}{realpath()}}
{\footnotesize\ttfamily char$\ast$ realpath (\begin{DoxyParamCaption}\item[{const char $\ast$}]{file\+\_\+name,  }\item[{char $\ast$}]{resolved\+\_\+name }\end{DoxyParamCaption})}



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\+LL} 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\+AX} bytes long. If {\ttfamily resolved\+\_\+name} is {\ttfamily N\+U\+LL}, 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 XP, errno is set in the following cases\+:

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

Supported OS\+: Windows XP. 