\hypertarget{group__vstack}{\section{Vstack}
\label{group__vstack}\index{Vstack@{Vstack}}
}


The requirements are described in doc/help/elektra-\/data-\/structures.\+md.  


Collaboration diagram for Vstack\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=288pt]{group__vstack}
\end{center}
\end{figure}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
Vstack $\ast$ \hyperlink{group__vstack_gad83493ea84a33554d53e35b5e5f85ffb}{elektra\+Vstack\+Init} (size\+\_\+t min\+Size)
\begin{DoxyCompactList}\small\item\em Allocates vstack with size specified by parameter min\+Size and sets the stack pointer. \end{DoxyCompactList}\item 
int \hyperlink{group__vstack_ga483ad909ca55b5757e3fe6e05c5ee240}{elektra\+Vstack\+Push} (Vstack $\ast$stack, void $\ast$data)
\begin{DoxyCompactList}\small\item\em Pushes an element in the Vstack and resizes the stack if needed. \end{DoxyCompactList}\item 
void $\ast$ \hyperlink{group__vstack_ga311785195ba8ee03ba8e7f953a5c772e}{elektra\+Vstack\+Pop} (Vstack $\ast$stack)
\begin{DoxyCompactList}\small\item\em Pops an element from the Vstack and resizes the stack if needed. \end{DoxyCompactList}\item 
int \hyperlink{group__vstack_gae2eb7657a51c430a63f64d754336db0b}{elektra\+Vstack\+Is\+Empty} (const Vstack $\ast$stack)
\begin{DoxyCompactList}\small\item\em Checks if the stack is empty. \end{DoxyCompactList}\item 
\hypertarget{group__vstack_gafc0a720e64b0185732a2517665fb97f2}{void \hyperlink{group__vstack_gafc0a720e64b0185732a2517665fb97f2}{elektra\+Vstack\+Del} (Vstack $\ast$stack)}\label{group__vstack_gafc0a720e64b0185732a2517665fb97f2}

\begin{DoxyCompactList}\small\item\em Deletes the stack, by freeing all memory. \end{DoxyCompactList}\item 
int \hyperlink{group__vstack_ga486d83054a50b723f90ac6bf74f94abc}{elektra\+Vstack\+Clear} (Vstack $\ast$stack)
\begin{DoxyCompactList}\small\item\em Clears the stack in a fast fashion. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
The requirements are described in doc/help/elektra-\/data-\/structures.\+md. 

The Vstack structure.

A stack implementation with dynamical memory allocation. The space gets doubled if full and reduced by half if used only a quarter of it, but not less than min\+Size. 

\subsection{Function Documentation}
\hypertarget{group__vstack_ga486d83054a50b723f90ac6bf74f94abc}{\index{Vstack@{Vstack}!elektra\+Vstack\+Clear@{elektra\+Vstack\+Clear}}
\index{elektra\+Vstack\+Clear@{elektra\+Vstack\+Clear}!Vstack@{Vstack}}
\subsubsection[{elektra\+Vstack\+Clear}]{\setlength{\rightskip}{0pt plus 5cm}int elektra\+Vstack\+Clear (
\begin{DoxyParamCaption}
\item[{Vstack $\ast$}]{stack}
\end{DoxyParamCaption}
)}}\label{group__vstack_ga486d83054a50b723f90ac6bf74f94abc}


Clears the stack in a fast fashion. 

Resets the stackpointer to the base and does not reallocate memory. The next reallocation happens at Pop.


\begin{DoxyRetVals}{Return values}
{\em 1} & on success \\
\hline
{\em 0} & on error \\
\hline
\end{DoxyRetVals}
\hypertarget{group__vstack_gad83493ea84a33554d53e35b5e5f85ffb}{\index{Vstack@{Vstack}!elektra\+Vstack\+Init@{elektra\+Vstack\+Init}}
\index{elektra\+Vstack\+Init@{elektra\+Vstack\+Init}!Vstack@{Vstack}}
\subsubsection[{elektra\+Vstack\+Init}]{\setlength{\rightskip}{0pt plus 5cm}Vstack$\ast$ elektra\+Vstack\+Init (
\begin{DoxyParamCaption}
\item[{size\+\_\+t}]{min\+Size}
\end{DoxyParamCaption}
)}}\label{group__vstack_gad83493ea84a33554d53e35b5e5f85ffb}


Allocates vstack with size specified by parameter min\+Size and sets the stack pointer. 


\begin{DoxyParams}{Parameters}
{\em min\+Size} & the minimum size of the stack \\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{Return values}
{\em a} & Vstack pointer \\
\hline
{\em N\+U\+L\+L} & error \\
\hline
\end{DoxyRetVals}
\hypertarget{group__vstack_gae2eb7657a51c430a63f64d754336db0b}{\index{Vstack@{Vstack}!elektra\+Vstack\+Is\+Empty@{elektra\+Vstack\+Is\+Empty}}
\index{elektra\+Vstack\+Is\+Empty@{elektra\+Vstack\+Is\+Empty}!Vstack@{Vstack}}
\subsubsection[{elektra\+Vstack\+Is\+Empty}]{\setlength{\rightskip}{0pt plus 5cm}int elektra\+Vstack\+Is\+Empty (
\begin{DoxyParamCaption}
\item[{const Vstack $\ast$}]{stack}
\end{DoxyParamCaption}
)}}\label{group__vstack_gae2eb7657a51c430a63f64d754336db0b}


Checks if the stack is empty. 


\begin{DoxyRetVals}{Return values}
{\em 1} & on empty \\
\hline
{\em 0} & on non empty \\
\hline
{\em -\/1} & on error \\
\hline
\end{DoxyRetVals}
\hypertarget{group__vstack_ga311785195ba8ee03ba8e7f953a5c772e}{\index{Vstack@{Vstack}!elektra\+Vstack\+Pop@{elektra\+Vstack\+Pop}}
\index{elektra\+Vstack\+Pop@{elektra\+Vstack\+Pop}!Vstack@{Vstack}}
\subsubsection[{elektra\+Vstack\+Pop}]{\setlength{\rightskip}{0pt plus 5cm}void$\ast$ elektra\+Vstack\+Pop (
\begin{DoxyParamCaption}
\item[{Vstack $\ast$}]{stack}
\end{DoxyParamCaption}
)}}\label{group__vstack_ga311785195ba8ee03ba8e7f953a5c772e}


Pops an element from the Vstack and resizes the stack if needed. 


\begin{DoxyRetVals}{Return values}
{\em the} & element \\
\hline
{\em N\+U\+L\+L} & on empty \\
\hline
\end{DoxyRetVals}
\hypertarget{group__vstack_ga483ad909ca55b5757e3fe6e05c5ee240}{\index{Vstack@{Vstack}!elektra\+Vstack\+Push@{elektra\+Vstack\+Push}}
\index{elektra\+Vstack\+Push@{elektra\+Vstack\+Push}!Vstack@{Vstack}}
\subsubsection[{elektra\+Vstack\+Push}]{\setlength{\rightskip}{0pt plus 5cm}int elektra\+Vstack\+Push (
\begin{DoxyParamCaption}
\item[{Vstack $\ast$}]{stack, }
\item[{void $\ast$}]{data}
\end{DoxyParamCaption}
)}}\label{group__vstack_ga483ad909ca55b5757e3fe6e05c5ee240}


Pushes an element in the Vstack and resizes the stack if needed. 


\begin{DoxyParams}{Parameters}
{\em data} & the element \\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{Return values}
{\em 0} & on error \\
\hline
{\em 1} & otherwise \\
\hline
\end{DoxyRetVals}
