\hypertarget{group__envstr}{
\section{envstr: Environment variables in a str.}
\label{group__envstr}\index{envstr: Environment variables in a str.@{envstr: Environment variables in a str.}}
}
\subsection*{Functions}
\begin{CompactItemize}
\item 
const char $\ast$ \hyperlink{group__envstr_g84cbf1d8cde4ec649b75eb81104279ea}{envstr\_\-find} (const struct \hyperlink{structstr}{str} $\ast$env, const char $\ast$var, long varlen)
\item 
const char $\ast$ \hyperlink{group__envstr_g492560b180478b56cd21bd8ba575b2f4}{envstr\_\-get} (const struct \hyperlink{structstr}{str} $\ast$env, const char $\ast$var)
\item 
int \hyperlink{group__envstr_g555d75c4667f80b5a92df9eab32cbe5a}{envstr\_\-set} (struct \hyperlink{structstr}{str} $\ast$env, const char $\ast$var, const char $\ast$val, int overwrite)
\item 
void \hyperlink{group__envstr_gc01247f87c994910acfaa32b67f78a13}{envstr\_\-unset} (struct \hyperlink{structstr}{str} $\ast$env, const char $\ast$var)
\item 
int \hyperlink{group__envstr_gc805aa4431ebdb4bf588bd9809494c5b}{envstr\_\-put} (struct \hyperlink{structstr}{str} $\ast$env, const char $\ast$asgn, int overwrite)
\item 
int \hyperlink{group__envstr_g534e89d64679f5a75cab6aa987952719}{envstr\_\-from\_\-array} (struct \hyperlink{structstr}{str} $\ast$env, char $\ast$$\ast$array, int overwrite)
\item 
int \hyperlink{group__envstr_g54ce162466679a29cadf5c4e20e2df01}{envstr\_\-from\_\-string} (struct \hyperlink{structstr}{str} $\ast$env, const char $\ast$s, int overwrite)
\item 
char $\ast$$\ast$ \hyperlink{group__envstr_gd725f553159f1c37bd3994d9f0e845f1}{envstr\_\-make\_\-array} (const struct \hyperlink{structstr}{str} $\ast$env)
\end{CompactItemize}


\subsection{Detailed Description}
\begin{Desc}
\item[Calling Convention]\end{Desc}
All functions that allocate memory return {\tt 0} (false) if the function failed due to being unable to allocate memory, and non-zero (true) otherwise. 

\subsection{Function Documentation}
\hypertarget{group__envstr_g84cbf1d8cde4ec649b75eb81104279ea}{
\index{envstr@{envstr}!envstr\_\-find@{envstr\_\-find}}
\index{envstr\_\-find@{envstr\_\-find}!envstr@{envstr}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const char$\ast$ envstr\_\-find (const struct {\bf str} $\ast$ {\em env}, const char $\ast$ {\em var}, long {\em len})}}
\label{group__envstr_g84cbf1d8cde4ec649b75eb81104279ea}


Find the named variable in the environment string. \begin{Desc}
\item[Returns:]a pointer to the {\bf start} of the assignment. \end{Desc}
\hypertarget{group__envstr_g534e89d64679f5a75cab6aa987952719}{
\index{envstr@{envstr}!envstr\_\-from\_\-array@{envstr\_\-from\_\-array}}
\index{envstr\_\-from\_\-array@{envstr\_\-from\_\-array}!envstr@{envstr}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int envstr\_\-from\_\-array (struct {\bf str} $\ast$ {\em env}, char $\ast$$\ast$ {\em array}, int {\em overwrite})}}
\label{group__envstr_g534e89d64679f5a75cab6aa987952719}


Adds the assignments from the array of pointers to the environment string. The array must be terminated by a {\tt NULL} pointer, just the same as the standard {\tt environ} array. \hypertarget{group__envstr_g54ce162466679a29cadf5c4e20e2df01}{
\index{envstr@{envstr}!envstr\_\-from\_\-string@{envstr\_\-from\_\-string}}
\index{envstr\_\-from\_\-string@{envstr\_\-from\_\-string}!envstr@{envstr}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int envstr\_\-from\_\-string (struct {\bf str} $\ast$ {\em env}, const char $\ast$ {\em s}, int {\em overwrite})}}
\label{group__envstr_g54ce162466679a29cadf5c4e20e2df01}


Adds the string-based list of assignments to the environment string. Each individual assignment in the list must be ASCII NUL terminated, and the final assignment must be followed by two ASCII NULs. \hypertarget{group__envstr_g492560b180478b56cd21bd8ba575b2f4}{
\index{envstr@{envstr}!envstr\_\-get@{envstr\_\-get}}
\index{envstr\_\-get@{envstr\_\-get}!envstr@{envstr}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const char$\ast$ envstr\_\-get (const struct {\bf str} $\ast$ {\em env}, const char $\ast$ {\em var})}}
\label{group__envstr_g492560b180478b56cd21bd8ba575b2f4}


Get the value of an assignment from an environment string. \hypertarget{group__envstr_gd725f553159f1c37bd3994d9f0e845f1}{
\index{envstr@{envstr}!envstr\_\-make\_\-array@{envstr\_\-make\_\-array}}
\index{envstr\_\-make\_\-array@{envstr\_\-make\_\-array}!envstr@{envstr}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}char$\ast$$\ast$ envstr\_\-make\_\-array (const struct {\bf str} $\ast$ {\em env})}}
\label{group__envstr_gd725f553159f1c37bd3994d9f0e845f1}


Make a {\tt environ} compatable array of pointers to the environment string. \begin{Desc}
\item[Note:]The returned pointer is dynamically allocated, and must be freed. \end{Desc}
\hypertarget{group__envstr_gc805aa4431ebdb4bf588bd9809494c5b}{
\index{envstr@{envstr}!envstr\_\-put@{envstr\_\-put}}
\index{envstr\_\-put@{envstr\_\-put}!envstr@{envstr}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int envstr\_\-put (struct {\bf str} $\ast$ {\em env}, const char $\ast$ {\em asgn}, int {\em overwrite})}}
\label{group__envstr_gc805aa4431ebdb4bf588bd9809494c5b}


Put an assignment, in {\tt NAME=value} format, into the environment string. \begin{Desc}
\item[Note:]Unlike putenv, a copy of the assignment is made instead of keeping a copy of the given pointer. \end{Desc}
\hypertarget{group__envstr_g555d75c4667f80b5a92df9eab32cbe5a}{
\index{envstr@{envstr}!envstr\_\-set@{envstr\_\-set}}
\index{envstr\_\-set@{envstr\_\-set}!envstr@{envstr}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int envstr\_\-set (struct {\bf str} $\ast$ {\em env}, const char $\ast$ {\em var}, const char $\ast$ {\em val}, int {\em overwrite})}}
\label{group__envstr_g555d75c4667f80b5a92df9eab32cbe5a}


Set the named variable to the given value in the environment string. \hypertarget{group__envstr_gc01247f87c994910acfaa32b67f78a13}{
\index{envstr@{envstr}!envstr\_\-unset@{envstr\_\-unset}}
\index{envstr\_\-unset@{envstr\_\-unset}!envstr@{envstr}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void envstr\_\-unset (struct {\bf str} $\ast$ {\em env}, const char $\ast$ {\em var})}}
\label{group__envstr_gc01247f87c994910acfaa32b67f78a13}


Unset the named variable in the environment string. 