\hypertarget{htp__list_8c}{\section{htp\-\_\-list.\-c File Reference} \label{htp__list_8c}\index{htp\-\_\-list.\-c@{htp\-\_\-list.\-c}} } {\ttfamily \#include \char`\"{}htp\-\_\-private.\-h\char`\"{}}\\* \subsection*{Functions} \begin{DoxyCompactItemize} \item \hyperlink{htp__list_8h_abf3c804b78ffe5d6ac235d27f16e0876}{htp\-\_\-list\-\_\-t} $\ast$ \hyperlink{htp__list_8c_a03714eb8cf358dd34b29cdb36061af79}{htp\-\_\-list\-\_\-array\-\_\-create} (size\-\_\-t size) \item void \hyperlink{htp__list_8c_a195c2a7aa02ce552679569845122db2d}{htp\-\_\-list\-\_\-array\-\_\-clear} (\hyperlink{structhtp__list__array__t}{htp\-\_\-list\-\_\-array\-\_\-t} $\ast$l) \item void \hyperlink{htp__list_8c_a61ba9d208a9a1cea26c574adb5fc9cf4}{htp\-\_\-list\-\_\-array\-\_\-destroy} (\hyperlink{structhtp__list__array__t}{htp\-\_\-list\-\_\-array\-\_\-t} $\ast$l) \item void $\ast$ \hyperlink{htp__list_8c_af7b2a65c6c19f9d41bcb0de34adb148b}{htp\-\_\-list\-\_\-array\-\_\-get} (const \hyperlink{structhtp__list__array__t}{htp\-\_\-list\-\_\-array\-\_\-t} $\ast$l, size\-\_\-t idx) \item void $\ast$ \hyperlink{htp__list_8c_a4dbebac7dcef30e345e50e2cc9d2ee70}{htp\-\_\-list\-\_\-array\-\_\-pop} (\hyperlink{structhtp__list__array__t}{htp\-\_\-list\-\_\-array\-\_\-t} $\ast$l) \item \hyperlink{htp__core_8h_ab8a71422665c0773654b9b4d96f01e31}{htp\-\_\-status\-\_\-t} \hyperlink{htp__list_8c_a5c8757fdc9427e8a8c776eaf5f4cbe5a}{htp\-\_\-list\-\_\-array\-\_\-push} (\hyperlink{structhtp__list__array__t}{htp\-\_\-list\-\_\-array\-\_\-t} $\ast$l, void $\ast$e) \item \hyperlink{htp__core_8h_ab8a71422665c0773654b9b4d96f01e31}{htp\-\_\-status\-\_\-t} \hyperlink{htp__list_8c_a0458bbad41bb93f7d5d01880243bbc47}{htp\-\_\-list\-\_\-array\-\_\-replace} (\hyperlink{structhtp__list__array__t}{htp\-\_\-list\-\_\-array\-\_\-t} $\ast$l, size\-\_\-t idx, void $\ast$e) \item size\-\_\-t \hyperlink{htp__list_8c_a1af3b347d55f358780e52e324c780e28}{htp\-\_\-list\-\_\-array\-\_\-size} (const \hyperlink{structhtp__list__array__t}{htp\-\_\-list\-\_\-array\-\_\-t} $\ast$l) \item void $\ast$ \hyperlink{htp__list_8c_a4992a64b4eb30afc51a445449a9b5613}{htp\-\_\-list\-\_\-array\-\_\-shift} (\hyperlink{structhtp__list__array__t}{htp\-\_\-list\-\_\-array\-\_\-t} $\ast$l) \end{DoxyCompactItemize} \subsection{Detailed Description} \begin{DoxyAuthor}{Author} Ivan Ristic \href{mailto:ivanr@webkreator.com}{\tt ivanr@webkreator.\-com} \end{DoxyAuthor} \subsection{Function Documentation} \hypertarget{htp__list_8c_a195c2a7aa02ce552679569845122db2d}{\index{htp\-\_\-list.\-c@{htp\-\_\-list.\-c}!htp\-\_\-list\-\_\-array\-\_\-clear@{htp\-\_\-list\-\_\-array\-\_\-clear}} \index{htp\-\_\-list\-\_\-array\-\_\-clear@{htp\-\_\-list\-\_\-array\-\_\-clear}!htp_list.c@{htp\-\_\-list.\-c}} \subsubsection[{htp\-\_\-list\-\_\-array\-\_\-clear}]{\setlength{\rightskip}{0pt plus 5cm}void htp\-\_\-list\-\_\-array\-\_\-clear ( \begin{DoxyParamCaption} \item[{{\bf htp\-\_\-list\-\_\-array\-\_\-t} $\ast$}]{l} \end{DoxyParamCaption} )}}\label{htp__list_8c_a195c2a7aa02ce552679569845122db2d} Remove all elements from the list. It is the responsibility of the caller to iterate over list elements and deallocate them if necessary, prior to invoking this function. \begin{DoxyParams}[1]{Parameters} \mbox{\tt in} & {\em l} & \\ \hline \end{DoxyParams} \hypertarget{htp__list_8c_a03714eb8cf358dd34b29cdb36061af79}{\index{htp\-\_\-list.\-c@{htp\-\_\-list.\-c}!htp\-\_\-list\-\_\-array\-\_\-create@{htp\-\_\-list\-\_\-array\-\_\-create}} \index{htp\-\_\-list\-\_\-array\-\_\-create@{htp\-\_\-list\-\_\-array\-\_\-create}!htp_list.c@{htp\-\_\-list.\-c}} \subsubsection[{htp\-\_\-list\-\_\-array\-\_\-create}]{\setlength{\rightskip}{0pt plus 5cm}{\bf htp\-\_\-list\-\_\-t}$\ast$ htp\-\_\-list\-\_\-array\-\_\-create ( \begin{DoxyParamCaption} \item[{size\-\_\-t}]{size} \end{DoxyParamCaption} )}}\label{htp__list_8c_a03714eb8cf358dd34b29cdb36061af79} Create new array-\/backed list. \begin{DoxyParams}[1]{Parameters} \mbox{\tt in} & {\em size} & \\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} Newly created list. \end{DoxyReturn} \hypertarget{htp__list_8c_a61ba9d208a9a1cea26c574adb5fc9cf4}{\index{htp\-\_\-list.\-c@{htp\-\_\-list.\-c}!htp\-\_\-list\-\_\-array\-\_\-destroy@{htp\-\_\-list\-\_\-array\-\_\-destroy}} \index{htp\-\_\-list\-\_\-array\-\_\-destroy@{htp\-\_\-list\-\_\-array\-\_\-destroy}!htp_list.c@{htp\-\_\-list.\-c}} \subsubsection[{htp\-\_\-list\-\_\-array\-\_\-destroy}]{\setlength{\rightskip}{0pt plus 5cm}void htp\-\_\-list\-\_\-array\-\_\-destroy ( \begin{DoxyParamCaption} \item[{{\bf htp\-\_\-list\-\_\-array\-\_\-t} $\ast$}]{l} \end{DoxyParamCaption} )}}\label{htp__list_8c_a61ba9d208a9a1cea26c574adb5fc9cf4} Free the memory occupied by this list. This function assumes the elements held by the list were freed beforehand. \begin{DoxyParams}[1]{Parameters} \mbox{\tt in} & {\em l} & \\ \hline \end{DoxyParams} \hypertarget{htp__list_8c_af7b2a65c6c19f9d41bcb0de34adb148b}{\index{htp\-\_\-list.\-c@{htp\-\_\-list.\-c}!htp\-\_\-list\-\_\-array\-\_\-get@{htp\-\_\-list\-\_\-array\-\_\-get}} \index{htp\-\_\-list\-\_\-array\-\_\-get@{htp\-\_\-list\-\_\-array\-\_\-get}!htp_list.c@{htp\-\_\-list.\-c}} \subsubsection[{htp\-\_\-list\-\_\-array\-\_\-get}]{\setlength{\rightskip}{0pt plus 5cm}void$\ast$ htp\-\_\-list\-\_\-array\-\_\-get ( \begin{DoxyParamCaption} \item[{const {\bf htp\-\_\-list\-\_\-array\-\_\-t} $\ast$}]{l, } \item[{size\-\_\-t}]{idx} \end{DoxyParamCaption} )}}\label{htp__list_8c_af7b2a65c6c19f9d41bcb0de34adb148b} Find the element at the given index. \begin{DoxyParams}[1]{Parameters} \mbox{\tt in} & {\em l} & \\ \hline \mbox{\tt in} & {\em idx} & \\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} the desired element, or N\-U\-L\-L if the list is too small, or if the element at that position carries a N\-U\-L\-L \end{DoxyReturn} \hypertarget{htp__list_8c_a4dbebac7dcef30e345e50e2cc9d2ee70}{\index{htp\-\_\-list.\-c@{htp\-\_\-list.\-c}!htp\-\_\-list\-\_\-array\-\_\-pop@{htp\-\_\-list\-\_\-array\-\_\-pop}} \index{htp\-\_\-list\-\_\-array\-\_\-pop@{htp\-\_\-list\-\_\-array\-\_\-pop}!htp_list.c@{htp\-\_\-list.\-c}} \subsubsection[{htp\-\_\-list\-\_\-array\-\_\-pop}]{\setlength{\rightskip}{0pt plus 5cm}void$\ast$ htp\-\_\-list\-\_\-array\-\_\-pop ( \begin{DoxyParamCaption} \item[{{\bf htp\-\_\-list\-\_\-array\-\_\-t} $\ast$}]{l} \end{DoxyParamCaption} )}}\label{htp__list_8c_a4dbebac7dcef30e345e50e2cc9d2ee70} Remove one element from the end of the list. \begin{DoxyParams}[1]{Parameters} \mbox{\tt in} & {\em l} & \\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} The removed element, or N\-U\-L\-L if the list is empty. \end{DoxyReturn} \hypertarget{htp__list_8c_a5c8757fdc9427e8a8c776eaf5f4cbe5a}{\index{htp\-\_\-list.\-c@{htp\-\_\-list.\-c}!htp\-\_\-list\-\_\-array\-\_\-push@{htp\-\_\-list\-\_\-array\-\_\-push}} \index{htp\-\_\-list\-\_\-array\-\_\-push@{htp\-\_\-list\-\_\-array\-\_\-push}!htp_list.c@{htp\-\_\-list.\-c}} \subsubsection[{htp\-\_\-list\-\_\-array\-\_\-push}]{\setlength{\rightskip}{0pt plus 5cm}{\bf htp\-\_\-status\-\_\-t} htp\-\_\-list\-\_\-array\-\_\-push ( \begin{DoxyParamCaption} \item[{{\bf htp\-\_\-list\-\_\-array\-\_\-t} $\ast$}]{l, } \item[{void $\ast$}]{e} \end{DoxyParamCaption} )}}\label{htp__list_8c_a5c8757fdc9427e8a8c776eaf5f4cbe5a} Add new element to the end of the list, expanding the list as necessary. \begin{DoxyParams}[1]{Parameters} \mbox{\tt in} & {\em l} & \\ \hline \mbox{\tt in} & {\em e} & \\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} H\-T\-P\-\_\-\-O\-K on success or H\-T\-P\-\_\-\-E\-R\-R\-O\-R on failure. \end{DoxyReturn} \hypertarget{htp__list_8c_a0458bbad41bb93f7d5d01880243bbc47}{\index{htp\-\_\-list.\-c@{htp\-\_\-list.\-c}!htp\-\_\-list\-\_\-array\-\_\-replace@{htp\-\_\-list\-\_\-array\-\_\-replace}} \index{htp\-\_\-list\-\_\-array\-\_\-replace@{htp\-\_\-list\-\_\-array\-\_\-replace}!htp_list.c@{htp\-\_\-list.\-c}} \subsubsection[{htp\-\_\-list\-\_\-array\-\_\-replace}]{\setlength{\rightskip}{0pt plus 5cm}{\bf htp\-\_\-status\-\_\-t} htp\-\_\-list\-\_\-array\-\_\-replace ( \begin{DoxyParamCaption} \item[{{\bf htp\-\_\-list\-\_\-array\-\_\-t} $\ast$}]{l, } \item[{size\-\_\-t}]{idx, } \item[{void $\ast$}]{e} \end{DoxyParamCaption} )}}\label{htp__list_8c_a0458bbad41bb93f7d5d01880243bbc47} Replace the element at the given index with the provided element. \begin{DoxyParams}[1]{Parameters} \mbox{\tt in} & {\em l} & \\ \hline \mbox{\tt in} & {\em idx} & \\ \hline \mbox{\tt in} & {\em e} & \\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} H\-T\-P\-\_\-\-O\-K if an element with the given index was replaced; H\-T\-P\-\_\-\-E\-R\-R\-O\-R if the desired index does not exist. \end{DoxyReturn} \hypertarget{htp__list_8c_a4992a64b4eb30afc51a445449a9b5613}{\index{htp\-\_\-list.\-c@{htp\-\_\-list.\-c}!htp\-\_\-list\-\_\-array\-\_\-shift@{htp\-\_\-list\-\_\-array\-\_\-shift}} \index{htp\-\_\-list\-\_\-array\-\_\-shift@{htp\-\_\-list\-\_\-array\-\_\-shift}!htp_list.c@{htp\-\_\-list.\-c}} \subsubsection[{htp\-\_\-list\-\_\-array\-\_\-shift}]{\setlength{\rightskip}{0pt plus 5cm}void$\ast$ htp\-\_\-list\-\_\-array\-\_\-shift ( \begin{DoxyParamCaption} \item[{{\bf htp\-\_\-list\-\_\-array\-\_\-t} $\ast$}]{l} \end{DoxyParamCaption} )}}\label{htp__list_8c_a4992a64b4eb30afc51a445449a9b5613} Remove one element from the beginning of the list. \begin{DoxyParams}[1]{Parameters} \mbox{\tt in} & {\em l} & \\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} The removed element, or N\-U\-L\-L if the list is empty. \end{DoxyReturn} \hypertarget{htp__list_8c_a1af3b347d55f358780e52e324c780e28}{\index{htp\-\_\-list.\-c@{htp\-\_\-list.\-c}!htp\-\_\-list\-\_\-array\-\_\-size@{htp\-\_\-list\-\_\-array\-\_\-size}} \index{htp\-\_\-list\-\_\-array\-\_\-size@{htp\-\_\-list\-\_\-array\-\_\-size}!htp_list.c@{htp\-\_\-list.\-c}} \subsubsection[{htp\-\_\-list\-\_\-array\-\_\-size}]{\setlength{\rightskip}{0pt plus 5cm}size\-\_\-t htp\-\_\-list\-\_\-array\-\_\-size ( \begin{DoxyParamCaption} \item[{const {\bf htp\-\_\-list\-\_\-array\-\_\-t} $\ast$}]{l} \end{DoxyParamCaption} )}}\label{htp__list_8c_a1af3b347d55f358780e52e324c780e28} Returns the size of the list. \begin{DoxyParams}[1]{Parameters} \mbox{\tt in} & {\em l} & \\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} List size. \end{DoxyReturn}