\hypertarget{group__Eina__Array__Group}{}\section{Array}
\label{group__Eina__Array__Group}\index{Array@{Array}}


These functions provide array management.  


\subsection*{Data Structures}
\begin{DoxyCompactItemize}
\item 
struct \hyperlink{struct__Eina__Array}{\+\_\+\+Eina\+\_\+\+Array}
\begin{DoxyCompactList}\small\item\em Type for an array of data. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\#define \hyperlink{group__Eina__Array__Group_ga810ed3618ca03f7d549a1bf2c33b2b6e}{E\+I\+N\+A\+\_\+\+A\+R\+R\+A\+Y\+\_\+\+I\+T\+E\+R\+\_\+\+N\+E\+X\+T}(array,  index,  item,  iterator)
\begin{DoxyCompactList}\small\item\em Macro to iterate over an array easily. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Typedefs}
\begin{DoxyCompactItemize}
\item 
\hypertarget{group__Eina__Array__Group_ga2a57284ee83a7e767485b7ae2f5df86c}{}typedef struct \hyperlink{struct__Eina__Array}{\+\_\+\+Eina\+\_\+\+Array} \hyperlink{group__Eina__Array__Group_ga2a57284ee83a7e767485b7ae2f5df86c}{Eina\+\_\+\+Array}\label{group__Eina__Array__Group_ga2a57284ee83a7e767485b7ae2f5df86c}

\begin{DoxyCompactList}\small\item\em Type for a generic vector. \end{DoxyCompactList}\item 
\hypertarget{group__Eina__Array__Group_gaf9af7cd8afa60d6b1cab805bd5b838aa}{}typedef void $\ast$$\ast$ \hyperlink{group__Eina__Array__Group_gaf9af7cd8afa60d6b1cab805bd5b838aa}{Eina\+\_\+\+Array\+\_\+\+Iterator}\label{group__Eina__Array__Group_gaf9af7cd8afa60d6b1cab805bd5b838aa}

\begin{DoxyCompactList}\small\item\em Type for an iterator on arrays, used with \hyperlink{group__Eina__Array__Group_ga810ed3618ca03f7d549a1bf2c33b2b6e}{E\+I\+N\+A\+\_\+\+A\+R\+R\+A\+Y\+\_\+\+I\+T\+E\+R\+\_\+\+N\+E\+X\+T}. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{group__Elua_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+P\+I} \hyperlink{group__Eina__Array__Group_ga2a57284ee83a7e767485b7ae2f5df86c}{Eina\+\_\+\+Array} $\ast$ \hyperlink{group__Eina__Array__Group_ga4a389204db37b44b31d29f581258ac7d}{eina\+\_\+array\+\_\+new} (unsigned int step) \hyperlink{group__Eina__Types__Group_ga4ba89e4b58eff707a6cf05ffe0cd4dea}{E\+I\+N\+A\+\_\+\+W\+A\+R\+N\+\_\+\+U\+N\+U\+S\+E\+D\+\_\+\+R\+E\+S\+U\+L\+T} \hyperlink{group__Eina__Types__Group_gaabeaa41dd47f4b4d3991b10ba00bc59c}{E\+I\+N\+A\+\_\+\+M\+A\+L\+L\+O\+C} \hyperlink{group__Eina__Types__Group_ga4ba89e4b58eff707a6cf05ffe0cd4dea}{E\+I\+N\+A\+\_\+\+W\+A\+R\+N\+\_\+\+U\+N\+U\+S\+E\+D\+\_\+\+R\+E\+S\+U\+L\+T}
\begin{DoxyCompactList}\small\item\em Create a new array. \end{DoxyCompactList}\item 
\hyperlink{group__Elua_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+P\+I} void \hyperlink{group__Eina__Array__Group_ga97995d81ca401d71a2913a52f8b40c41}{eina\+\_\+array\+\_\+free} (\hyperlink{group__Eina__Array__Group_ga2a57284ee83a7e767485b7ae2f5df86c}{Eina\+\_\+\+Array} $\ast$array) \hyperlink{group__Eina__Types__Group_ga1a066aa3069f7e43279021cc1e378fac}{E\+I\+N\+A\+\_\+\+A\+R\+G\+\_\+\+N\+O\+N\+N\+U\+L\+L}(1)
\begin{DoxyCompactList}\small\item\em Free an array. \end{DoxyCompactList}\item 
\hyperlink{group__Elua_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+P\+I} void \hyperlink{group__Eina__Array__Group_ga310eb050803ee5d4d2894d322f4c088f}{eina\+\_\+array\+\_\+step\+\_\+set} (\hyperlink{group__Eina__Array__Group_ga2a57284ee83a7e767485b7ae2f5df86c}{Eina\+\_\+\+Array} $\ast$array, unsigned int sizeof\+\_\+eina\+\_\+array, unsigned int step) \hyperlink{group__Eina__Types__Group_ga1a066aa3069f7e43279021cc1e378fac}{E\+I\+N\+A\+\_\+\+A\+R\+G\+\_\+\+N\+O\+N\+N\+U\+L\+L}(1)
\begin{DoxyCompactList}\small\item\em Set the step of an array. \end{DoxyCompactList}\item 
static void \hyperlink{group__Eina__Array__Group_ga09564606d36b330d63ec1dde1e96a749}{eina\+\_\+array\+\_\+clean} (\hyperlink{group__Eina__Array__Group_ga2a57284ee83a7e767485b7ae2f5df86c}{Eina\+\_\+\+Array} $\ast$array) \hyperlink{group__Eina__Types__Group_ga1a066aa3069f7e43279021cc1e378fac}{E\+I\+N\+A\+\_\+\+A\+R\+G\+\_\+\+N\+O\+N\+N\+U\+L\+L}(1)
\begin{DoxyCompactList}\small\item\em Clean an array. \end{DoxyCompactList}\item 
\hyperlink{group__Elua_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+P\+I} void \hyperlink{group__Eina__Array__Group_ga639f5cbf991ff9a5c4951b77cd143bed}{eina\+\_\+array\+\_\+flush} (\hyperlink{group__Eina__Array__Group_ga2a57284ee83a7e767485b7ae2f5df86c}{Eina\+\_\+\+Array} $\ast$array) \hyperlink{group__Eina__Types__Group_ga1a066aa3069f7e43279021cc1e378fac}{E\+I\+N\+A\+\_\+\+A\+R\+G\+\_\+\+N\+O\+N\+N\+U\+L\+L}(1)
\begin{DoxyCompactList}\small\item\em Flush an array. \end{DoxyCompactList}\item 
\hyperlink{group__Elua_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+P\+I} \hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool} \hyperlink{group__Eina__Array__Group_gab4171f1665fadbf71ff3f418258e8a31}{eina\+\_\+array\+\_\+remove} (\hyperlink{group__Eina__Array__Group_ga2a57284ee83a7e767485b7ae2f5df86c}{Eina\+\_\+\+Array} $\ast$array, \hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool}($\ast$keep)(void $\ast$data, void $\ast$gdata), void $\ast$gdata) \hyperlink{group__Eina__Types__Group_ga1a066aa3069f7e43279021cc1e378fac}{E\+I\+N\+A\+\_\+\+A\+R\+G\+\_\+\+N\+O\+N\+N\+U\+L\+L}(1
\begin{DoxyCompactList}\small\item\em Rebuild an array by specifying the data to keep. \end{DoxyCompactList}\item 
\hyperlink{group__Elua_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+P\+I} \hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool} static \hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool} \hyperlink{group__Eina__Array__Group_gaf2f4a5907f1826354977adbd63e3379a}{eina\+\_\+array\+\_\+push} (\hyperlink{group__Eina__Array__Group_ga2a57284ee83a7e767485b7ae2f5df86c}{Eina\+\_\+\+Array} $\ast$array, const void $\ast$data) \hyperlink{group__Eina__Types__Group_ga1a066aa3069f7e43279021cc1e378fac}{E\+I\+N\+A\+\_\+\+A\+R\+G\+\_\+\+N\+O\+N\+N\+U\+L\+L}(1
\begin{DoxyCompactList}\small\item\em Append a data to an array. \end{DoxyCompactList}\item 
\hyperlink{group__Elua_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+P\+I} \hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool} static \hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool} static void $\ast$ \hyperlink{group__Eina__Array__Group_gaffa602b526b5da4d2b59910f68dd270f}{eina\+\_\+array\+\_\+pop} (\hyperlink{group__Eina__Array__Group_ga2a57284ee83a7e767485b7ae2f5df86c}{Eina\+\_\+\+Array} $\ast$array) \hyperlink{group__Eina__Types__Group_ga1a066aa3069f7e43279021cc1e378fac}{E\+I\+N\+A\+\_\+\+A\+R\+G\+\_\+\+N\+O\+N\+N\+U\+L\+L}(1)
\begin{DoxyCompactList}\small\item\em Remove the last data of an array. \end{DoxyCompactList}\item 
static void $\ast$ \hyperlink{group__Eina__Array__Group_ga3c8c1ae6e979cc7b4890421ec63543f1}{eina\+\_\+array\+\_\+data\+\_\+get} (const \hyperlink{group__Eina__Array__Group_ga2a57284ee83a7e767485b7ae2f5df86c}{Eina\+\_\+\+Array} $\ast$array, unsigned int idx) \hyperlink{group__Eina__Types__Group_ga1a066aa3069f7e43279021cc1e378fac}{E\+I\+N\+A\+\_\+\+A\+R\+G\+\_\+\+N\+O\+N\+N\+U\+L\+L}(1)
\begin{DoxyCompactList}\small\item\em Return the data at a given position in an array. \end{DoxyCompactList}\item 
static void \hyperlink{group__Eina__Array__Group_ga466c2d377561b4dde4a4c67988ba32f6}{eina\+\_\+array\+\_\+data\+\_\+set} (const \hyperlink{group__Eina__Array__Group_ga2a57284ee83a7e767485b7ae2f5df86c}{Eina\+\_\+\+Array} $\ast$array, unsigned int idx, const void $\ast$data) \hyperlink{group__Eina__Types__Group_ga1a066aa3069f7e43279021cc1e378fac}{E\+I\+N\+A\+\_\+\+A\+R\+G\+\_\+\+N\+O\+N\+N\+U\+L\+L}(1)
\begin{DoxyCompactList}\small\item\em Set the data at a given position in an array. \end{DoxyCompactList}\item 
static unsigned int \hyperlink{group__Eina__Array__Group_ga726e6cd38ce207513734d2c19473758f}{eina\+\_\+array\+\_\+count\+\_\+get} (const \hyperlink{group__Eina__Array__Group_ga2a57284ee83a7e767485b7ae2f5df86c}{Eina\+\_\+\+Array} $\ast$array) \hyperlink{group__Eina__Types__Group_ga1a066aa3069f7e43279021cc1e378fac}{E\+I\+N\+A\+\_\+\+A\+R\+G\+\_\+\+N\+O\+N\+N\+U\+L\+L}(1) \hyperlink{group__Eina__Types__Group_ga4ba89e4b58eff707a6cf05ffe0cd4dea}{E\+I\+N\+A\+\_\+\+W\+A\+R\+N\+\_\+\+U\+N\+U\+S\+E\+D\+\_\+\+R\+E\+S\+U\+L\+T}
\begin{DoxyCompactList}\small\item\em Return the number of elements in an array. \end{DoxyCompactList}\item 
static unsigned int \hyperlink{group__Eina__Array__Group_ga803b2c0bde44a344dd55d790235c254e}{eina\+\_\+array\+\_\+count} (const \hyperlink{group__Eina__Array__Group_ga2a57284ee83a7e767485b7ae2f5df86c}{Eina\+\_\+\+Array} $\ast$array) \hyperlink{group__Eina__Types__Group_ga1a066aa3069f7e43279021cc1e378fac}{E\+I\+N\+A\+\_\+\+A\+R\+G\+\_\+\+N\+O\+N\+N\+U\+L\+L}(1) \hyperlink{group__Eina__Types__Group_ga4ba89e4b58eff707a6cf05ffe0cd4dea}{E\+I\+N\+A\+\_\+\+W\+A\+R\+N\+\_\+\+U\+N\+U\+S\+E\+D\+\_\+\+R\+E\+S\+U\+L\+T}
\begin{DoxyCompactList}\small\item\em Return the number of elements in an array. \end{DoxyCompactList}\item 
\hyperlink{group__Elua_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+P\+I} \hyperlink{group__Eina__Iterator__Group_ga15b975bb881d955249ce13d4ebc96948}{Eina\+\_\+\+Iterator} $\ast$ \hyperlink{group__Eina__Array__Group_ga3cc5cffcf52a2e8c60a651f8df66fbdf}{eina\+\_\+array\+\_\+iterator\+\_\+new} (const \hyperlink{group__Eina__Array__Group_ga2a57284ee83a7e767485b7ae2f5df86c}{Eina\+\_\+\+Array} $\ast$array) \hyperlink{group__Eina__Types__Group_gaabeaa41dd47f4b4d3991b10ba00bc59c}{E\+I\+N\+A\+\_\+\+M\+A\+L\+L\+O\+C} \hyperlink{group__Eina__Types__Group_ga1a066aa3069f7e43279021cc1e378fac}{E\+I\+N\+A\+\_\+\+A\+R\+G\+\_\+\+N\+O\+N\+N\+U\+L\+L}(1) \hyperlink{group__Eina__Types__Group_ga4ba89e4b58eff707a6cf05ffe0cd4dea}{E\+I\+N\+A\+\_\+\+W\+A\+R\+N\+\_\+\+U\+N\+U\+S\+E\+D\+\_\+\+R\+E\+S\+U\+L\+T}
\begin{DoxyCompactList}\small\item\em Get a new iterator associated to an array. \end{DoxyCompactList}\item 
\hyperlink{group__Elua_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+P\+I} \hyperlink{group__Eina__Accessor__Group_ga65199ea5201a1867471028477dc26744}{Eina\+\_\+\+Accessor} $\ast$ \hyperlink{group__Eina__Array__Group_gab0886ce166e67d0e395e9e90b808d9b0}{eina\+\_\+array\+\_\+accessor\+\_\+new} (const \hyperlink{group__Eina__Array__Group_ga2a57284ee83a7e767485b7ae2f5df86c}{Eina\+\_\+\+Array} $\ast$array) \hyperlink{group__Eina__Types__Group_gaabeaa41dd47f4b4d3991b10ba00bc59c}{E\+I\+N\+A\+\_\+\+M\+A\+L\+L\+O\+C} \hyperlink{group__Eina__Types__Group_ga1a066aa3069f7e43279021cc1e378fac}{E\+I\+N\+A\+\_\+\+A\+R\+G\+\_\+\+N\+O\+N\+N\+U\+L\+L}(1) \hyperlink{group__Eina__Types__Group_ga4ba89e4b58eff707a6cf05ffe0cd4dea}{E\+I\+N\+A\+\_\+\+W\+A\+R\+N\+\_\+\+U\+N\+U\+S\+E\+D\+\_\+\+R\+E\+S\+U\+L\+T}
\begin{DoxyCompactList}\small\item\em Get a new accessor associated to an array. \end{DoxyCompactList}\item 
static \hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool} \hyperlink{group__Eina__Array__Group_ga8de2d191a0fffceb5bdc6376540b8db1}{eina\+\_\+array\+\_\+foreach} (\hyperlink{group__Eina__Array__Group_ga2a57284ee83a7e767485b7ae2f5df86c}{Eina\+\_\+\+Array} $\ast$array, \hyperlink{group__Eina__Types__Group_gab115f6c19b6641ab5ba22ed45d9b7aa4}{Eina\+\_\+\+Each\+\_\+\+Cb} cb, void $\ast$fdata)
\begin{DoxyCompactList}\small\item\em Provide a safe way to iterate over an array. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
These functions provide array management. 

The Array data type in Eina is designed to have very fast access to its data (compared to the Eina \hyperlink{group__Eina__List__Group}{List}). On the other hand, data can be added or removed only at the end of the array. To insert data at any position, the Eina \hyperlink{group__Eina__List__Group}{List} is the correct container to use.

To use the array data type, \hyperlink{group__Eina__Main__Group_gabf448ada5bc81a07342b66c6f818ee5e}{eina\+\_\+init()} must be called before any other array functions. When no more eina array functions are used, \hyperlink{group__Eina__Main__Group_ga6741fcaba116e31e96ce14dcfa03f568}{eina\+\_\+shutdown()} must be called to free all the resources.

An array must be created with \hyperlink{group__Eina__Array__Group_ga4a389204db37b44b31d29f581258ac7d}{eina\+\_\+array\+\_\+new()}. It allocates all the necessary data for an array. When not needed anymore, an array is freed with \hyperlink{group__Eina__Array__Group_ga97995d81ca401d71a2913a52f8b40c41}{eina\+\_\+array\+\_\+free()}. This frees the memory used by the Eina\+\_\+\+Array itself, but does not free any memory used to store the data of each element. To free that memory you must iterate over the array and free each data element individually. A convenient way to do that is by using \hyperlink{group__Eina__Array__Group_ga810ed3618ca03f7d549a1bf2c33b2b6e}{E\+I\+N\+A\+\_\+\+A\+R\+R\+A\+Y\+\_\+\+I\+T\+E\+R\+\_\+\+N\+E\+X\+T}. An example of that pattern is given in the description of \hyperlink{group__Eina__Array__Group_ga810ed3618ca03f7d549a1bf2c33b2b6e}{E\+I\+N\+A\+\_\+\+A\+R\+R\+A\+Y\+\_\+\+I\+T\+E\+R\+\_\+\+N\+E\+X\+T}.

\begin{DoxyWarning}{Warning}
Functions do not check if the used array is valid or not. It\textquotesingle{}s up to the user to be sure of that. It is designed like that for performance reasons.
\end{DoxyWarning}
The usual features of an array are classic ones\+: to append an element, use \hyperlink{group__Eina__Array__Group_gaf2f4a5907f1826354977adbd63e3379a}{eina\+\_\+array\+\_\+push()} and to remove the last element, use \hyperlink{group__Eina__Array__Group_gaffa602b526b5da4d2b59910f68dd270f}{eina\+\_\+array\+\_\+pop()}. To retrieve the element at a given position, use \hyperlink{group__Eina__Array__Group_ga3c8c1ae6e979cc7b4890421ec63543f1}{eina\+\_\+array\+\_\+data\+\_\+get()}. The number of elements can be retrieved with \hyperlink{group__Eina__Array__Group_ga803b2c0bde44a344dd55d790235c254e}{eina\+\_\+array\+\_\+count()}.

Eina\+\_\+\+Array is different from a conventional C array in a number of ways, most importantly they grow and shrink dynamically, this means that if you add an element to a full array it grows and that when you remove an element from an array it {\bfseries may} shrink.

Allocating memory is expensive, so when the array needs to grow it allocates enough memory to hold {\ttfamily step} additonal elements, not just the element currently being added. Similarly if you remove elements, it won\textquotesingle{}t free space until you have removed {\ttfamily step} elements.

The following image illustrates how an Eina\+\_\+\+Array grows\+:

 
\begin{DoxyImageNoCaption}
  \mbox{\includegraphics[width=\textwidth]{eina_array-growth}}
\end{DoxyImageNoCaption}


Eina\+\_\+\+Array only stores pointers but it can store data of any type in the form of void pointers.

See here some examples\+: \begin{DoxyItemize}
\item \hyperlink{eina_array_01_example_page}{Basic array usage} \item \hyperlink{eina_array_02_example_page}{Removing array elements} \end{DoxyItemize}


\subsection{Macro Definition Documentation}
\hypertarget{group__Eina__Array__Group_ga810ed3618ca03f7d549a1bf2c33b2b6e}{}\index{Array@{Array}!E\+I\+N\+A\+\_\+\+A\+R\+R\+A\+Y\+\_\+\+I\+T\+E\+R\+\_\+\+N\+E\+X\+T@{E\+I\+N\+A\+\_\+\+A\+R\+R\+A\+Y\+\_\+\+I\+T\+E\+R\+\_\+\+N\+E\+X\+T}}
\index{E\+I\+N\+A\+\_\+\+A\+R\+R\+A\+Y\+\_\+\+I\+T\+E\+R\+\_\+\+N\+E\+X\+T@{E\+I\+N\+A\+\_\+\+A\+R\+R\+A\+Y\+\_\+\+I\+T\+E\+R\+\_\+\+N\+E\+X\+T}!Array@{Array}}
\subsubsection[{E\+I\+N\+A\+\_\+\+A\+R\+R\+A\+Y\+\_\+\+I\+T\+E\+R\+\_\+\+N\+E\+X\+T}]{\setlength{\rightskip}{0pt plus 5cm}\#define E\+I\+N\+A\+\_\+\+A\+R\+R\+A\+Y\+\_\+\+I\+T\+E\+R\+\_\+\+N\+E\+X\+T(
\begin{DoxyParamCaption}
\item[{}]{array, }
\item[{}]{index, }
\item[{}]{item, }
\item[{}]{iterator}
\end{DoxyParamCaption}
)}\label{group__Eina__Array__Group_ga810ed3618ca03f7d549a1bf2c33b2b6e}
{\bfseries Value\+:}
\begin{DoxyCode}
\textcolor{keywordflow}{for} (index = 0, iterator = (array)->data;                                 \(\backslash\)
       (index < \hyperlink{group__Eina__Array__Group_ga803b2c0bde44a344dd55d790235c254e}{eina\_array\_count}(array)) && ((item = *((iterator)++)));     \(\backslash\)
                                                  ++(index))
\end{DoxyCode}


Macro to iterate over an array easily. 


\begin{DoxyParams}{Parameters}
{\em array} & The array to iterate over. \\
\hline
{\em index} & The integer number that is increased while iterating. \\
\hline
{\em item} & The data \\
\hline
{\em iterator} & The iterator\\
\hline
\end{DoxyParams}
This macro allows the iteration over {\ttfamily array} in an easy way. It iterates from the first element to the last one. {\ttfamily index} is an integer that increases from 0 to the number of elements. {\ttfamily item} is the data of each element of {\ttfamily array}, so it is a pointer to a type chosen by the user. {\ttfamily iterator} is of type \hyperlink{group__Eina__Array__Group_gaf9af7cd8afa60d6b1cab805bd5b838aa}{Eina\+\_\+\+Array\+\_\+\+Iterator}.

This macro can be used for freeing the data of an array, like in the following example\+:


\begin{DoxyCode}
1 Eina\_Array         *array;
2 char               *item;
3 Eina\_Array\_Iterator iterator;
4 unsigned int        i;
5 
6 // array is already filled,
7 // its elements are just duplicated strings,
8 // EINA\_ARRAY\_ITER\_NEXT will be used to free those strings
9 
10 EINA\_ARRAY\_ITER\_NEXT(array, i, item, iterator)
11   free(item);
\end{DoxyCode}
 \begin{Desc}
\item[Examples\+: ]\par
\hyperlink{eina_array_02_8c-example}{eina\+\_\+array\+\_\+02.\+c}.\end{Desc}


Referenced by eina\+\_\+benchmark\+\_\+free(), eina\+\_\+module\+\_\+find(), eina\+\_\+module\+\_\+list\+\_\+free(), eina\+\_\+module\+\_\+list\+\_\+load(), and eina\+\_\+module\+\_\+list\+\_\+unload().



\subsection{Function Documentation}
\hypertarget{group__Eina__Array__Group_ga4a389204db37b44b31d29f581258ac7d}{}\index{Array@{Array}!eina\+\_\+array\+\_\+new@{eina\+\_\+array\+\_\+new}}
\index{eina\+\_\+array\+\_\+new@{eina\+\_\+array\+\_\+new}!Array@{Array}}
\subsubsection[{eina\+\_\+array\+\_\+new(unsigned int step) E\+I\+N\+A\+\_\+\+W\+A\+R\+N\+\_\+\+U\+N\+U\+S\+E\+D\+\_\+\+R\+E\+S\+U\+L\+T E\+I\+N\+A\+\_\+\+M\+A\+L\+L\+O\+C E\+I\+N\+A\+\_\+\+W\+A\+R\+N\+\_\+\+U\+N\+U\+S\+E\+D\+\_\+\+R\+E\+S\+U\+L\+T}]{\setlength{\rightskip}{0pt plus 5cm}{\bf E\+A\+P\+I} {\bf Eina\+\_\+\+Array}$\ast$ eina\+\_\+array\+\_\+new (
\begin{DoxyParamCaption}
\item[{unsigned int}]{step}
\end{DoxyParamCaption}
)}\label{group__Eina__Array__Group_ga4a389204db37b44b31d29f581258ac7d}


Create a new array. 


\begin{DoxyParams}{Parameters}
{\em step} & The count of pointers to add when increasing the array size. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
{\ttfamily N\+U\+L\+L} on failure, non {\ttfamily N\+U\+L\+L} otherwise.
\end{DoxyReturn}
This function creates a new array. When adding an element, the array allocates {\ttfamily step} elements. When that buffer is full, then adding another element will increase the buffer by {\ttfamily step} elements again.

This function return a valid array on success, or {\ttfamily N\+U\+L\+L} if memory allocation fails. 

References \+\_\+\+Eina\+\_\+\+Array\+::count, \+\_\+\+Eina\+\_\+\+Array\+::data, E\+I\+N\+A\+\_\+\+M\+A\+G\+I\+C\+\_\+\+S\+E\+T, \+\_\+\+Eina\+\_\+\+Array\+::step, \+\_\+\+Eina\+\_\+\+Array\+::total, and \+\_\+\+Eina\+\_\+\+Array\+::version.



Referenced by eina\+\_\+benchmark\+\_\+run(), eina\+\_\+file\+\_\+split(), eina\+\_\+module\+\_\+arch\+\_\+list\+\_\+get(), eina\+\_\+module\+\_\+list\+\_\+get(), eldbus\+\_\+service\+\_\+property\+\_\+changed(), and evas\+\_\+device\+\_\+push().

\hypertarget{group__Eina__Array__Group_ga97995d81ca401d71a2913a52f8b40c41}{}\index{Array@{Array}!eina\+\_\+array\+\_\+free@{eina\+\_\+array\+\_\+free}}
\index{eina\+\_\+array\+\_\+free@{eina\+\_\+array\+\_\+free}!Array@{Array}}
\subsubsection[{eina\+\_\+array\+\_\+free(\+Eina\+\_\+\+Array $\ast$array) E\+I\+N\+A\+\_\+\+A\+R\+G\+\_\+\+N\+O\+N\+N\+U\+L\+L(1)}]{\setlength{\rightskip}{0pt plus 5cm}{\bf E\+A\+P\+I} void eina\+\_\+array\+\_\+free (
\begin{DoxyParamCaption}
\item[{{\bf Eina\+\_\+\+Array} $\ast$}]{array}
\end{DoxyParamCaption}
)}\label{group__Eina__Array__Group_ga97995d81ca401d71a2913a52f8b40c41}


Free an array. 


\begin{DoxyParams}{Parameters}
{\em array} & The array to free.\\
\hline
\end{DoxyParams}
This function frees {\ttfamily array}. It calls first \hyperlink{group__Eina__Array__Group_ga639f5cbf991ff9a5c4951b77cd143bed}{eina\+\_\+array\+\_\+flush()} then free the memory of the pointer. It does not free the memory allocated for the elements of {\ttfamily array}. To free them, walk the array with \hyperlink{group__Eina__Array__Group_ga810ed3618ca03f7d549a1bf2c33b2b6e}{E\+I\+N\+A\+\_\+\+A\+R\+R\+A\+Y\+\_\+\+I\+T\+E\+R\+\_\+\+N\+E\+X\+T}. For performance reasons, there is no check of {\ttfamily array}. 

References eina\+\_\+array\+\_\+flush().



Referenced by ecore\+\_\+buffer\+\_\+shutdown(), and eina\+\_\+benchmark\+\_\+free().

\hypertarget{group__Eina__Array__Group_ga310eb050803ee5d4d2894d322f4c088f}{}\index{Array@{Array}!eina\+\_\+array\+\_\+step\+\_\+set@{eina\+\_\+array\+\_\+step\+\_\+set}}
\index{eina\+\_\+array\+\_\+step\+\_\+set@{eina\+\_\+array\+\_\+step\+\_\+set}!Array@{Array}}
\subsubsection[{eina\+\_\+array\+\_\+step\+\_\+set(\+Eina\+\_\+\+Array $\ast$array, unsigned int sizeof\+\_\+eina\+\_\+array, unsigned int step) E\+I\+N\+A\+\_\+\+A\+R\+G\+\_\+\+N\+O\+N\+N\+U\+L\+L(1)}]{\setlength{\rightskip}{0pt plus 5cm}{\bf E\+A\+P\+I} void eina\+\_\+array\+\_\+step\+\_\+set (
\begin{DoxyParamCaption}
\item[{{\bf Eina\+\_\+\+Array} $\ast$}]{array, }
\item[{unsigned int}]{sizeof\+\_\+eina\+\_\+array, }
\item[{unsigned int}]{step}
\end{DoxyParamCaption}
)}\label{group__Eina__Array__Group_ga310eb050803ee5d4d2894d322f4c088f}


Set the step of an array. 


\begin{DoxyParams}{Parameters}
{\em array} & The array. \\
\hline
{\em sizeof\+\_\+eina\+\_\+array} & Should be the value returned by sizeof(\+Eina\+\_\+\+Array). \\
\hline
{\em step} & The count of pointers to add when increasing the array size.\\
\hline
\end{DoxyParams}
This function sets the step of {\ttfamily array} to {\ttfamily step}. For performance reasons, there is no check of {\ttfamily array}. If it is {\ttfamily N\+U\+L\+L} or invalid, the program may crash.

\begin{DoxyWarning}{Warning}
This function can {\bfseries only} be called on uninitialized arrays. 
\end{DoxyWarning}


References \+\_\+\+Eina\+\_\+\+Array\+::count, \+\_\+\+Eina\+\_\+\+Array\+::data, E\+I\+N\+A\+\_\+\+M\+A\+G\+I\+C\+\_\+\+S\+E\+T, E\+R\+R, \+\_\+\+Eina\+\_\+\+Array\+::step, \+\_\+\+Eina\+\_\+\+Array\+::total, and \+\_\+\+Eina\+\_\+\+Array\+::version.

\hypertarget{group__Eina__Array__Group_ga09564606d36b330d63ec1dde1e96a749}{}\index{Array@{Array}!eina\+\_\+array\+\_\+clean@{eina\+\_\+array\+\_\+clean}}
\index{eina\+\_\+array\+\_\+clean@{eina\+\_\+array\+\_\+clean}!Array@{Array}}
\subsubsection[{eina\+\_\+array\+\_\+clean(\+Eina\+\_\+\+Array $\ast$array) E\+I\+N\+A\+\_\+\+A\+R\+G\+\_\+\+N\+O\+N\+N\+U\+L\+L(1)}]{\setlength{\rightskip}{0pt plus 5cm}static void eina\+\_\+array\+\_\+clean (
\begin{DoxyParamCaption}
\item[{{\bf Eina\+\_\+\+Array} $\ast$}]{array}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}\label{group__Eina__Array__Group_ga09564606d36b330d63ec1dde1e96a749}


Clean an array. 


\begin{DoxyParams}{Parameters}
{\em array} & The array to clean.\\
\hline
\end{DoxyParams}
This function sets the count member of {\ttfamily array} to 0, however it doesn\textquotesingle{}t free any space. This is particularly useful if you need to empty the array and add lots of elements quickly. For performance reasons, there is no check of {\ttfamily array}. If it is {\ttfamily N\+U\+L\+L} or invalid, the program may crash. \begin{Desc}
\item[Examples\+: ]\par
\hyperlink{eina_array_02_8c-example}{eina\+\_\+array\+\_\+02.\+c}.\end{Desc}
\hypertarget{group__Eina__Array__Group_ga639f5cbf991ff9a5c4951b77cd143bed}{}\index{Array@{Array}!eina\+\_\+array\+\_\+flush@{eina\+\_\+array\+\_\+flush}}
\index{eina\+\_\+array\+\_\+flush@{eina\+\_\+array\+\_\+flush}!Array@{Array}}
\subsubsection[{eina\+\_\+array\+\_\+flush(\+Eina\+\_\+\+Array $\ast$array) E\+I\+N\+A\+\_\+\+A\+R\+G\+\_\+\+N\+O\+N\+N\+U\+L\+L(1)}]{\setlength{\rightskip}{0pt plus 5cm}{\bf E\+A\+P\+I} void eina\+\_\+array\+\_\+flush (
\begin{DoxyParamCaption}
\item[{{\bf Eina\+\_\+\+Array} $\ast$}]{array}
\end{DoxyParamCaption}
)}\label{group__Eina__Array__Group_ga639f5cbf991ff9a5c4951b77cd143bed}


Flush an array. 


\begin{DoxyParams}{Parameters}
{\em array} & The array to flush.\\
\hline
\end{DoxyParams}
This function sets the count and total members of {\ttfamily array} to 0, frees and set to N\+U\+L\+L its data member. For performance reasons, there is no check of {\ttfamily array}. If it is {\ttfamily N\+U\+L\+L} or invalid, the program may crash. 

References \+\_\+\+Eina\+\_\+\+Array\+::count, \+\_\+\+Eina\+\_\+\+Array\+::data, and \+\_\+\+Eina\+\_\+\+Array\+::total.



Referenced by efl\+::eina\+::ptr\+\_\+array$<$ Eo, std\+::conditional$<$ std\+::is\+\_\+same$<$ Clone\+Allocator, default\+\_\+clone\+\_\+allocator\+\_\+placeholder $>$\+::value, eo\+\_\+clone\+\_\+allocator, Clone\+Allocator $>$\+::type $>$\+::clear(), eina\+\_\+array\+\_\+free(), and eina\+\_\+module\+\_\+list\+\_\+free().

\hypertarget{group__Eina__Array__Group_gab4171f1665fadbf71ff3f418258e8a31}{}\index{Array@{Array}!eina\+\_\+array\+\_\+remove@{eina\+\_\+array\+\_\+remove}}
\index{eina\+\_\+array\+\_\+remove@{eina\+\_\+array\+\_\+remove}!Array@{Array}}
\subsubsection[{eina\+\_\+array\+\_\+remove(\+Eina\+\_\+\+Array $\ast$array, Eina\+\_\+\+Bool($\ast$keep)(void $\ast$data, void $\ast$gdata), void $\ast$gdata) E\+I\+N\+A\+\_\+\+A\+R\+G\+\_\+\+N\+O\+N\+N\+U\+L\+L(1}]{\setlength{\rightskip}{0pt plus 5cm}{\bf E\+A\+P\+I} {\bf Eina\+\_\+\+Bool} eina\+\_\+array\+\_\+remove (
\begin{DoxyParamCaption}
\item[{{\bf Eina\+\_\+\+Array} $\ast$}]{array, }
\item[{{\bf Eina\+\_\+\+Bool}($\ast$)(void $\ast$data, void $\ast$gdata)}]{keep, }
\item[{void $\ast$}]{gdata}
\end{DoxyParamCaption}
)}\label{group__Eina__Array__Group_gab4171f1665fadbf71ff3f418258e8a31}


Rebuild an array by specifying the data to keep. 


\begin{DoxyParams}{Parameters}
{\em array} & The array. \\
\hline
{\em keep} & The functions which selects the data to keep. \\
\hline
{\em gdata} & The data to pass to the function keep. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{E\+I\+N\+A\+\_\+\+T\+R\+U\+E} on success, \hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{E\+I\+N\+A\+\_\+\+F\+A\+L\+S\+E} otherwise.
\end{DoxyReturn}
This function rebuilds {\ttfamily array} be specifying the elements to keep with the function {\ttfamily keep}. No empty/invalid fields are left in the array. {\ttfamily gdata} is an additional data to pass to {\ttfamily keep}. For performance reasons, there is no check of {\ttfamily array}. If it is {\ttfamily N\+U\+L\+L} or invalid, the program may crash.

If it wasn\textquotesingle{}t able to remove items due to an allocation failure, it will return \hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{E\+I\+N\+A\+\_\+\+F\+A\+L\+S\+E}. \begin{Desc}
\item[Examples\+: ]\par
\hyperlink{eina_array_02_8c-example}{eina\+\_\+array\+\_\+02.\+c}.\end{Desc}
\hypertarget{group__Eina__Array__Group_gaf2f4a5907f1826354977adbd63e3379a}{}\index{Array@{Array}!eina\+\_\+array\+\_\+push@{eina\+\_\+array\+\_\+push}}
\index{eina\+\_\+array\+\_\+push@{eina\+\_\+array\+\_\+push}!Array@{Array}}
\subsubsection[{eina\+\_\+array\+\_\+push(\+Eina\+\_\+\+Array $\ast$array, const void $\ast$data) E\+I\+N\+A\+\_\+\+A\+R\+G\+\_\+\+N\+O\+N\+N\+U\+L\+L(1}]{\setlength{\rightskip}{0pt plus 5cm}{\bf E\+A\+P\+I} {\bf Eina\+\_\+\+Bool} static {\bf Eina\+\_\+\+Bool} eina\+\_\+array\+\_\+push (
\begin{DoxyParamCaption}
\item[{{\bf Eina\+\_\+\+Array} $\ast$}]{array, }
\item[{const void $\ast$}]{data}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}\label{group__Eina__Array__Group_gaf2f4a5907f1826354977adbd63e3379a}


Append a data to an array. 


\begin{DoxyParams}{Parameters}
{\em array} & The array. \\
\hline
{\em data} & The data to add. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{E\+I\+N\+A\+\_\+\+T\+R\+U\+E} on success, \hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{E\+I\+N\+A\+\_\+\+F\+A\+L\+S\+E} otherwise.
\end{DoxyReturn}
This function appends {\ttfamily data} to {\ttfamily array}. For performance reasons, there is no check of {\ttfamily array}. If it is {\ttfamily N\+U\+L\+L} or invalid, the program may crash. If {\ttfamily data} is {\ttfamily N\+U\+L\+L}, or if an allocation is necessary and fails, \hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{E\+I\+N\+A\+\_\+\+F\+A\+L\+S\+E} is returned Otherwise, \hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{E\+I\+N\+A\+\_\+\+T\+R\+U\+E} is returned. \begin{Desc}
\item[Examples\+: ]\par
\hyperlink{eina_accessor_01_8c-example}{eina\+\_\+accessor\+\_\+01.\+c}, \hyperlink{eina_array_01_8c-example}{eina\+\_\+array\+\_\+01.\+c}, \hyperlink{eina_array_02_8c-example}{eina\+\_\+array\+\_\+02.\+c}, \hyperlink{eina_iterator_01_8c-example}{eina\+\_\+iterator\+\_\+01.\+c}, and \hyperlink{eina_simple_xml_parser_01_8c-example}{eina\+\_\+simple\+\_\+xml\+\_\+parser\+\_\+01.\+c}.\end{Desc}


Referenced by eina\+\_\+benchmark\+\_\+run(), eina\+\_\+file\+\_\+split(), eldbus\+\_\+service\+\_\+property\+\_\+changed(), evas\+\_\+device\+\_\+push(), efl\+::eina\+::ptr\+\_\+array$<$ Eo, std\+::conditional$<$ std\+::is\+\_\+same$<$ Clone\+Allocator, default\+\_\+clone\+\_\+allocator\+\_\+placeholder $>$\+::value, eo\+\_\+clone\+\_\+allocator, Clone\+Allocator $>$\+::type $>$\+::insert(), and efl\+::eina\+::ptr\+\_\+array$<$ Eo, std\+::conditional$<$ std\+::is\+\_\+same$<$ Clone\+Allocator, default\+\_\+clone\+\_\+allocator\+\_\+placeholder $>$\+::value, eo\+\_\+clone\+\_\+allocator, Clone\+Allocator $>$\+::type $>$\+::push\+\_\+back().

\hypertarget{group__Eina__Array__Group_gaffa602b526b5da4d2b59910f68dd270f}{}\index{Array@{Array}!eina\+\_\+array\+\_\+pop@{eina\+\_\+array\+\_\+pop}}
\index{eina\+\_\+array\+\_\+pop@{eina\+\_\+array\+\_\+pop}!Array@{Array}}
\subsubsection[{eina\+\_\+array\+\_\+pop(\+Eina\+\_\+\+Array $\ast$array) E\+I\+N\+A\+\_\+\+A\+R\+G\+\_\+\+N\+O\+N\+N\+U\+L\+L(1)}]{\setlength{\rightskip}{0pt plus 5cm}{\bf E\+A\+P\+I} {\bf Eina\+\_\+\+Bool} static {\bf Eina\+\_\+\+Bool} static void$\ast$ eina\+\_\+array\+\_\+pop (
\begin{DoxyParamCaption}
\item[{{\bf Eina\+\_\+\+Array} $\ast$}]{array}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}\label{group__Eina__Array__Group_gaffa602b526b5da4d2b59910f68dd270f}


Remove the last data of an array. 


\begin{DoxyParams}{Parameters}
{\em array} & The array. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The retrieved data.
\end{DoxyReturn}
This function removes the last data of {\ttfamily array}, decreases the count of {\ttfamily array} and returns the data. For performance reasons, there is no check of {\ttfamily array}. If it is {\ttfamily N\+U\+L\+L} or invalid, the program may crash. If the count member is less or equal than 0, {\ttfamily N\+U\+L\+L} is returned. \begin{Desc}
\item[Examples\+: ]\par
\hyperlink{eina_array_01_8c-example}{eina\+\_\+array\+\_\+01.\+c}.\end{Desc}


Referenced by efl\+::eina\+::ptr\+\_\+array$<$ Eo, std\+::conditional$<$ std\+::is\+\_\+same$<$ Clone\+Allocator, default\+\_\+clone\+\_\+allocator\+\_\+placeholder $>$\+::value, eo\+\_\+clone\+\_\+allocator, Clone\+Allocator $>$\+::type $>$\+::erase(), evas\+\_\+device\+\_\+pop(), and efl\+::eina\+::ptr\+\_\+array$<$ Eo, std\+::conditional$<$ std\+::is\+\_\+same$<$ Clone\+Allocator, default\+\_\+clone\+\_\+allocator\+\_\+placeholder $>$\+::value, eo\+\_\+clone\+\_\+allocator, Clone\+Allocator $>$\+::type $>$\+::pop\+\_\+back().

\hypertarget{group__Eina__Array__Group_ga3c8c1ae6e979cc7b4890421ec63543f1}{}\index{Array@{Array}!eina\+\_\+array\+\_\+data\+\_\+get@{eina\+\_\+array\+\_\+data\+\_\+get}}
\index{eina\+\_\+array\+\_\+data\+\_\+get@{eina\+\_\+array\+\_\+data\+\_\+get}!Array@{Array}}
\subsubsection[{eina\+\_\+array\+\_\+data\+\_\+get(const Eina\+\_\+\+Array $\ast$array, unsigned int idx) E\+I\+N\+A\+\_\+\+A\+R\+G\+\_\+\+N\+O\+N\+N\+U\+L\+L(1)}]{\setlength{\rightskip}{0pt plus 5cm}static void$\ast$ eina\+\_\+array\+\_\+data\+\_\+get (
\begin{DoxyParamCaption}
\item[{const {\bf Eina\+\_\+\+Array} $\ast$}]{array, }
\item[{unsigned int}]{idx}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}\label{group__Eina__Array__Group_ga3c8c1ae6e979cc7b4890421ec63543f1}


Return the data at a given position in an array. 


\begin{DoxyParams}{Parameters}
{\em array} & The array. \\
\hline
{\em idx} & The potition of the data to retrieve. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The retrieved data.
\end{DoxyReturn}
This function returns the data at the position {\ttfamily idx} in {\ttfamily array}. For performance reasons, there is no check of {\ttfamily array} or {\ttfamily idx}. If it is {\ttfamily N\+U\+L\+L} or invalid, the program may crash. \begin{Desc}
\item[Examples\+: ]\par
\hyperlink{eina_array_01_8c-example}{eina\+\_\+array\+\_\+01.\+c}.\end{Desc}


Referenced by eldbus\+\_\+service\+\_\+signal\+\_\+emit().

\hypertarget{group__Eina__Array__Group_ga466c2d377561b4dde4a4c67988ba32f6}{}\index{Array@{Array}!eina\+\_\+array\+\_\+data\+\_\+set@{eina\+\_\+array\+\_\+data\+\_\+set}}
\index{eina\+\_\+array\+\_\+data\+\_\+set@{eina\+\_\+array\+\_\+data\+\_\+set}!Array@{Array}}
\subsubsection[{eina\+\_\+array\+\_\+data\+\_\+set(const Eina\+\_\+\+Array $\ast$array, unsigned int idx, const void $\ast$data) E\+I\+N\+A\+\_\+\+A\+R\+G\+\_\+\+N\+O\+N\+N\+U\+L\+L(1)}]{\setlength{\rightskip}{0pt plus 5cm}static void eina\+\_\+array\+\_\+data\+\_\+set (
\begin{DoxyParamCaption}
\item[{const {\bf Eina\+\_\+\+Array} $\ast$}]{array, }
\item[{unsigned int}]{idx, }
\item[{const void $\ast$}]{data}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}\label{group__Eina__Array__Group_ga466c2d377561b4dde4a4c67988ba32f6}


Set the data at a given position in an array. 


\begin{DoxyParams}{Parameters}
{\em array} & The array. \\
\hline
{\em idx} & The position of the data to set. \\
\hline
{\em data} & The data to set.\\
\hline
\end{DoxyParams}
This function sets the data at the position {\ttfamily idx} in {\ttfamily array} to {\ttfamily data}, this effectively replaces the previously held data, you must therefore get a pointer to it first if you need to free it. For performance reasons, there is no check of {\ttfamily array} or {\ttfamily idx}. If it is {\ttfamily N\+U\+L\+L} or invalid, the program may crash. \begin{Desc}
\item[Examples\+: ]\par
\hyperlink{eina_array_02_8c-example}{eina\+\_\+array\+\_\+02.\+c}.\end{Desc}
\hypertarget{group__Eina__Array__Group_ga726e6cd38ce207513734d2c19473758f}{}\index{Array@{Array}!eina\+\_\+array\+\_\+count\+\_\+get@{eina\+\_\+array\+\_\+count\+\_\+get}}
\index{eina\+\_\+array\+\_\+count\+\_\+get@{eina\+\_\+array\+\_\+count\+\_\+get}!Array@{Array}}
\subsubsection[{eina\+\_\+array\+\_\+count\+\_\+get(const Eina\+\_\+\+Array $\ast$array) E\+I\+N\+A\+\_\+\+A\+R\+G\+\_\+\+N\+O\+N\+N\+U\+L\+L(1) E\+I\+N\+A\+\_\+\+W\+A\+R\+N\+\_\+\+U\+N\+U\+S\+E\+D\+\_\+\+R\+E\+S\+U\+L\+T}]{\setlength{\rightskip}{0pt plus 5cm}static unsigned int eina\+\_\+array\+\_\+count\+\_\+get (
\begin{DoxyParamCaption}
\item[{const {\bf Eina\+\_\+\+Array} $\ast$}]{array}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}\label{group__Eina__Array__Group_ga726e6cd38ce207513734d2c19473758f}


Return the number of elements in an array. 


\begin{DoxyParams}{Parameters}
{\em array} & The array. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The number of elements.
\end{DoxyReturn}
This function returns the number of elements in {\ttfamily array} (array-\/$>$count). For performance reasons, there is no check of {\ttfamily array}. If it is {\ttfamily N\+U\+L\+L} or invalid, the program may crash.

\begin{DoxyRefDesc}{Deprecated}
\item[\hyperlink{deprecated__deprecated000026}{Deprecated}]use \hyperlink{group__Eina__Array__Group_ga803b2c0bde44a344dd55d790235c254e}{eina\+\_\+array\+\_\+count()} \end{DoxyRefDesc}
\hypertarget{group__Eina__Array__Group_ga803b2c0bde44a344dd55d790235c254e}{}\index{Array@{Array}!eina\+\_\+array\+\_\+count@{eina\+\_\+array\+\_\+count}}
\index{eina\+\_\+array\+\_\+count@{eina\+\_\+array\+\_\+count}!Array@{Array}}
\subsubsection[{eina\+\_\+array\+\_\+count(const Eina\+\_\+\+Array $\ast$array) E\+I\+N\+A\+\_\+\+A\+R\+G\+\_\+\+N\+O\+N\+N\+U\+L\+L(1) E\+I\+N\+A\+\_\+\+W\+A\+R\+N\+\_\+\+U\+N\+U\+S\+E\+D\+\_\+\+R\+E\+S\+U\+L\+T}]{\setlength{\rightskip}{0pt plus 5cm}static unsigned int eina\+\_\+array\+\_\+count (
\begin{DoxyParamCaption}
\item[{const {\bf Eina\+\_\+\+Array} $\ast$}]{array}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}\label{group__Eina__Array__Group_ga803b2c0bde44a344dd55d790235c254e}


Return the number of elements in an array. 


\begin{DoxyParams}{Parameters}
{\em array} & The array. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The number of elements.
\end{DoxyReturn}
This function returns the number of elements in {\ttfamily array} (array-\/$>$count). For performance reasons, there is no check of {\ttfamily array}. If it is {\ttfamily N\+U\+L\+L} or invalid, the program may crash. \begin{Desc}
\item[Examples\+: ]\par
\hyperlink{eina_array_01_8c-example}{eina\+\_\+array\+\_\+01.\+c}.\end{Desc}


Referenced by ecore\+\_\+buffer\+\_\+init(), eldbus\+\_\+service\+\_\+signal\+\_\+emit(), eldbus\+\_\+service\+\_\+signal\+\_\+new(), and efl\+::eina\+::ptr\+\_\+array$<$ Eo, std\+::conditional$<$ std\+::is\+\_\+same$<$ Clone\+Allocator, default\+\_\+clone\+\_\+allocator\+\_\+placeholder $>$\+::value, eo\+\_\+clone\+\_\+allocator, Clone\+Allocator $>$\+::type $>$\+::size().

\hypertarget{group__Eina__Array__Group_ga3cc5cffcf52a2e8c60a651f8df66fbdf}{}\index{Array@{Array}!eina\+\_\+array\+\_\+iterator\+\_\+new@{eina\+\_\+array\+\_\+iterator\+\_\+new}}
\index{eina\+\_\+array\+\_\+iterator\+\_\+new@{eina\+\_\+array\+\_\+iterator\+\_\+new}!Array@{Array}}
\subsubsection[{eina\+\_\+array\+\_\+iterator\+\_\+new(const Eina\+\_\+\+Array $\ast$array) E\+I\+N\+A\+\_\+\+M\+A\+L\+L\+O\+C E\+I\+N\+A\+\_\+\+A\+R\+G\+\_\+\+N\+O\+N\+N\+U\+L\+L(1) E\+I\+N\+A\+\_\+\+W\+A\+R\+N\+\_\+\+U\+N\+U\+S\+E\+D\+\_\+\+R\+E\+S\+U\+L\+T}]{\setlength{\rightskip}{0pt plus 5cm}{\bf E\+A\+P\+I} {\bf Eina\+\_\+\+Iterator}$\ast$ eina\+\_\+array\+\_\+iterator\+\_\+new (
\begin{DoxyParamCaption}
\item[{const {\bf Eina\+\_\+\+Array} $\ast$}]{array}
\end{DoxyParamCaption}
)}\label{group__Eina__Array__Group_ga3cc5cffcf52a2e8c60a651f8df66fbdf}


Get a new iterator associated to an array. 


\begin{DoxyParams}{Parameters}
{\em array} & The array. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
A new iterator.
\end{DoxyReturn}
This function returns a newly allocated iterator associated to {\ttfamily array}. If {\ttfamily array} is {\ttfamily N\+U\+L\+L} or the count member of {\ttfamily array} is less or equal than 0, this function returns {\ttfamily N\+U\+L\+L}. If the memory can not be allocated, {\ttfamily N\+U\+L\+L} is returned. Otherwise, a valid iterator is returned. 

References E\+I\+N\+A\+\_\+\+M\+A\+G\+I\+C\+\_\+\+S\+E\+T, F\+U\+N\+C\+\_\+\+I\+T\+E\+R\+A\+T\+O\+R\+\_\+\+F\+R\+E\+E, F\+U\+N\+C\+\_\+\+I\+T\+E\+R\+A\+T\+O\+R\+\_\+\+G\+E\+T\+\_\+\+C\+O\+N\+T\+A\+I\+N\+E\+R, F\+U\+N\+C\+\_\+\+I\+T\+E\+R\+A\+T\+O\+R\+\_\+\+N\+E\+X\+T, and \+\_\+\+Eina\+\_\+\+Array\+::version.

\hypertarget{group__Eina__Array__Group_gab0886ce166e67d0e395e9e90b808d9b0}{}\index{Array@{Array}!eina\+\_\+array\+\_\+accessor\+\_\+new@{eina\+\_\+array\+\_\+accessor\+\_\+new}}
\index{eina\+\_\+array\+\_\+accessor\+\_\+new@{eina\+\_\+array\+\_\+accessor\+\_\+new}!Array@{Array}}
\subsubsection[{eina\+\_\+array\+\_\+accessor\+\_\+new(const Eina\+\_\+\+Array $\ast$array) E\+I\+N\+A\+\_\+\+M\+A\+L\+L\+O\+C E\+I\+N\+A\+\_\+\+A\+R\+G\+\_\+\+N\+O\+N\+N\+U\+L\+L(1) E\+I\+N\+A\+\_\+\+W\+A\+R\+N\+\_\+\+U\+N\+U\+S\+E\+D\+\_\+\+R\+E\+S\+U\+L\+T}]{\setlength{\rightskip}{0pt plus 5cm}{\bf E\+A\+P\+I} {\bf Eina\+\_\+\+Accessor}$\ast$ eina\+\_\+array\+\_\+accessor\+\_\+new (
\begin{DoxyParamCaption}
\item[{const {\bf Eina\+\_\+\+Array} $\ast$}]{array}
\end{DoxyParamCaption}
)}\label{group__Eina__Array__Group_gab0886ce166e67d0e395e9e90b808d9b0}


Get a new accessor associated to an array. 


\begin{DoxyParams}{Parameters}
{\em array} & The array. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
A new accessor.
\end{DoxyReturn}
This function returns a newly allocated accessor associated to {\ttfamily array}. If {\ttfamily array} is {\ttfamily N\+U\+L\+L} or the count member of {\ttfamily array} is less or equal than 0, this function returns {\ttfamily N\+U\+L\+L}. If the memory can not be allocated, {\ttfamily N\+U\+L\+L} is returned. Otherwise, a valid accessor is returned. 

References E\+I\+N\+A\+\_\+\+M\+A\+G\+I\+C\+\_\+\+S\+E\+T, F\+U\+N\+C\+\_\+\+A\+C\+C\+E\+S\+S\+O\+R\+\_\+\+C\+L\+O\+N\+E, F\+U\+N\+C\+\_\+\+A\+C\+C\+E\+S\+S\+O\+R\+\_\+\+F\+R\+E\+E, F\+U\+N\+C\+\_\+\+A\+C\+C\+E\+S\+S\+O\+R\+\_\+\+G\+E\+T\+\_\+\+A\+T, F\+U\+N\+C\+\_\+\+A\+C\+C\+E\+S\+S\+O\+R\+\_\+\+G\+E\+T\+\_\+\+C\+O\+N\+T\+A\+I\+N\+E\+R, and \+\_\+\+Eina\+\_\+\+Array\+::version.



Referenced by efl\+::eina\+::ptr\+\_\+array$<$ Eo, std\+::conditional$<$ std\+::is\+\_\+same$<$ Clone\+Allocator, default\+\_\+clone\+\_\+allocator\+\_\+placeholder $>$\+::value, eo\+\_\+clone\+\_\+allocator, Clone\+Allocator $>$\+::type $>$\+::accessor().

\hypertarget{group__Eina__Array__Group_ga8de2d191a0fffceb5bdc6376540b8db1}{}\index{Array@{Array}!eina\+\_\+array\+\_\+foreach@{eina\+\_\+array\+\_\+foreach}}
\index{eina\+\_\+array\+\_\+foreach@{eina\+\_\+array\+\_\+foreach}!Array@{Array}}
\subsubsection[{eina\+\_\+array\+\_\+foreach(\+Eina\+\_\+\+Array $\ast$array, Eina\+\_\+\+Each\+\_\+\+Cb cb, void $\ast$fdata)}]{\setlength{\rightskip}{0pt plus 5cm}static {\bf Eina\+\_\+\+Bool} eina\+\_\+array\+\_\+foreach (
\begin{DoxyParamCaption}
\item[{{\bf Eina\+\_\+\+Array} $\ast$}]{array, }
\item[{{\bf Eina\+\_\+\+Each\+\_\+\+Cb}}]{cb, }
\item[{void $\ast$}]{fdata}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}\label{group__Eina__Array__Group_ga8de2d191a0fffceb5bdc6376540b8db1}


Provide a safe way to iterate over an array. 


\begin{DoxyParams}{Parameters}
{\em array} & The array to iterate over. \\
\hline
{\em cb} & The callback to call for each item. \\
\hline
{\em fdata} & The user data to pass to the callback. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{E\+I\+N\+A\+\_\+\+T\+R\+U\+E} if it successfully iterate all items of the array.
\end{DoxyReturn}
This function provides a safe way to iterate over an array. {\ttfamily cb} should return \hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{E\+I\+N\+A\+\_\+\+T\+R\+U\+E} as long as you want the function to continue iterating. If {\ttfamily cb} returns \hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{E\+I\+N\+A\+\_\+\+F\+A\+L\+S\+E}, iterations will stop and the function will also return \hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{E\+I\+N\+A\+\_\+\+F\+A\+L\+S\+E}. \begin{Desc}
\item[Examples\+: ]\par
\hyperlink{eina_array_01_8c-example}{eina\+\_\+array\+\_\+01.\+c}, and \hyperlink{eina_simple_xml_parser_01_8c-example}{eina\+\_\+simple\+\_\+xml\+\_\+parser\+\_\+01.\+c}.\end{Desc}
