\begin{DoxyDate}{Date}
2008 (created)
\end{DoxyDate}
\hypertarget{eina_cxx_main_toc}{}\section{Table of Contents}\label{eina_cxx_main_toc}
\begin{DoxyItemize}
\item \mbox{\hyperlink{eina_main_eina_main_intro}{Introduction}} \item \mbox{\hyperlink{eina_main_eina_main_compiling}{How to compile}} \item \mbox{\hyperlink{eina_main_eina_main_next_steps}{Next Steps}} \item \mbox{\hyperlink{eina_main_eina_main_intro_example}{Introductory Example}}\end{DoxyItemize}
\hypertarget{eina_main_eina_main_intro}{}\section{Introduction}\label{eina_main_eina_main_intro}
The Eina library is a library that implements an A\+PI for data types in an efficient way. It also provides some useful tools like opening shared libraries, errors management, type conversion, time accounting and memory pool.

This library is cross-\/platform and can be compiled and used on Linux, B\+SD, Opensolaris and Windows (XP and CE).

The data types that are available are (see \mbox{\hyperlink{group__Eina__Data__Types__Group}{Data Types}})\+: \begin{DoxyItemize}
\item \mbox{\hyperlink{group__Eina__Fp__Group}{Fp}} standard floating point numbers. \item \mbox{\hyperlink{group__Eina__Inline__Array__Group}{Inline Array}} standard array of inlined members. \item \mbox{\hyperlink{group__Eina__Array__Group}{Array}} standard array of {\ttfamily void$\ast$} data. \item \mbox{\hyperlink{group__Eina__Hash__Group}{Hash Table}} standard hash of {\ttfamily void$\ast$} data. \item \mbox{\hyperlink{group__Eina__Inline__List__Group}{Inline List}} list with nodes inlined into user type. \item \mbox{\hyperlink{group__Eina__CList__Group}{Compact List}} Compact List. \item \mbox{\hyperlink{group__Eina__List__Group}{List}} standard list of {\ttfamily void$\ast$} data. \item \mbox{\hyperlink{group__Eina__Iterator__Group}{Iterator Functions}} Iterator functions. \item \mbox{\hyperlink{group__Eina__Matrixsparse__Group}{Sparse Matrix}} sparse matrix of {\ttfamily void$\ast$} data. \item \mbox{\hyperlink{group__Eina__Rbtree__Group}{Red-\/\+Black tree}} red-\/black tree with nodes inlined into user type. \item \mbox{\hyperlink{group__Eina__String__Buffer__Group}{String Buffer}} mutable string to prepend, insert or append strings to a buffer. \item \mbox{\hyperlink{group__Eina__Stringshare__Group}{Stringshare}} saves memory by sharing read-\/only string references. \item \mbox{\hyperlink{group__Eina__Tiler__Group}{Tiler}} split, merge and navigates into 2D tiled regions. \item \mbox{\hyperlink{group__Eina__Trash__Group}{Trash}} container of unused but allocated data. \item \mbox{\hyperlink{group__Eina__Value__Group}{Generic Value Storage}} container for generic value storage and access.\end{DoxyItemize}
The tools that are available are (see \mbox{\hyperlink{group__Eina__Tools__Group}{Tools}})\+: \begin{DoxyItemize}
\item \mbox{\hyperlink{group__Eina__Benchmark__Group}{Benchmark}} helper to write benchmarks. \item \mbox{\hyperlink{group__Eina__Convert__Group}{Convert}} faster conversion from strings to integers, double, etc. \item \mbox{\hyperlink{group__Eina__Counter__Group}{Counter}} measures number of calls and their time. \item \mbox{\hyperlink{group__Eina__Cpu__Group}{Cpu}} Cpu and architecture related helpers. \item \mbox{\hyperlink{group__Eina__Error__Group}{Error}} error identifiers. \item \mbox{\hyperlink{group__Eina__File__Group}{File}} simple file list and path split. \item \mbox{\hyperlink{group__Eina__Lalloc__Group}{Lazy allocator}} simple lazy allocator. \item \mbox{\hyperlink{group__Eina__Log__Group}{Log}} full-\/featured logging system. \item \mbox{\hyperlink{group__Eina__Magic__Group}{Magic}} provides runtime type checking. \item \mbox{\hyperlink{group__Eina__Memory__Pool__Group}{Memory Pool}} abstraction for various memory allocators. \item \mbox{\hyperlink{group__Eina__Module__Group}{Module}} lists, loads and share modules using Eina\+\_\+\+Module standard. \item \mbox{\hyperlink{group__Eina__Rectangle__Group}{Rectangle}} rectangle structure and standard manipulation methods. \item \mbox{\hyperlink{group__Eina__Safety__Checks__Group}{Safety Checks}} extra checks that will report unexpected conditions and can be disabled at compile time. \item \mbox{\hyperlink{group__Eina__String__Group}{String}} a set of functions that manages C strings.\end{DoxyItemize}
\hypertarget{eina_main_eina_main_compiling}{}\section{How to compile}\label{eina_main_eina_main_compiling}
Eina is a library your application links to. The procedure for this is very simple. You simply have to compile your application with the appropriate compiler flags that the {\ttfamily pkg-\/config} script outputs. For example\+:

Compiling C or C++ files into object files\+:

\begin{DoxyVerb}gcc -c -o main.o main.c `pkg-config --cflags eina`
\end{DoxyVerb}


Linking object files into a binary executable\+:

\begin{DoxyVerb}gcc -o my_application main.o `pkg-config --libs eina`
\end{DoxyVerb}


See \mbox{\hyperlink{pkgconfig}{pkgconfig}}\hypertarget{eina_main_eina_main_next_steps}{}\section{Next Steps}\label{eina_main_eina_main_next_steps}
After you understood what Eina is and installed it in your system you should proceed understanding the programming interface.

Recommended reading\+:

\begin{DoxyItemize}
\item \mbox{\hyperlink{group__Eina__Data__Types__Group}{Data Types}} to find about implemented types and how to use them. \item \mbox{\hyperlink{group__Eina__Tools__Group}{Tools}} to find about helper tools provided by eina.\end{DoxyItemize}
\hypertarget{eina_main_eina_main_intro_example}{}\section{Introductory Example}\label{eina_main_eina_main_intro_example}

\begin{DoxyCodeInclude}
\textcolor{comment}{//Compile with:}
\textcolor{comment}{//gcc -g eina\_list\_01.c -o eina\_list\_01 `pkg-config --cflags --libs eina`}

\textcolor{preprocessor}{#include <stdio.h>}
\textcolor{preprocessor}{#include <\mbox{\hyperlink{Eina_8h}{Eina.h}}>}

\textcolor{keywordtype}{int}
main(\textcolor{keywordtype}{int} argc, \textcolor{keywordtype}{char} **argv)
\{
   (void)argc;
   (void)argv;
   \mbox{\hyperlink{struct__Eina__List}{Eina\_List}} *list = NULL;
   \mbox{\hyperlink{struct__Eina__List}{Eina\_List}} *l;
   \textcolor{keywordtype}{void} *list\_data;

   \mbox{\hyperlink{group__Eina__Main__Group_gabf448ada5bc81a07342b66c6f818ee5e}{eina\_init}}();

   list = \mbox{\hyperlink{group__Eina__List__Group_ga92ec14d1a1040a361c4d8cd0ab7b0ecc}{eina\_list\_append}}(list, \textcolor{stringliteral}{"tigh"});
   list = \mbox{\hyperlink{group__Eina__List__Group_ga92ec14d1a1040a361c4d8cd0ab7b0ecc}{eina\_list\_append}}(list, \textcolor{stringliteral}{"adar"});
   list = \mbox{\hyperlink{group__Eina__List__Group_ga92ec14d1a1040a361c4d8cd0ab7b0ecc}{eina\_list\_append}}(list, \textcolor{stringliteral}{"baltar"});
   list = \mbox{\hyperlink{group__Eina__List__Group_ga92ec14d1a1040a361c4d8cd0ab7b0ecc}{eina\_list\_append}}(list, \textcolor{stringliteral}{"roslin"});

   \mbox{\hyperlink{group__Eina__List__Group_gac6efafc19f526d916cdb9757240a8773}{EINA\_LIST\_FOREACH}}(list, l, list\_data)
     printf(\textcolor{stringliteral}{"%s\(\backslash\)n"}, (\textcolor{keywordtype}{char}*)list\_data);
   printf(\textcolor{stringliteral}{"\(\backslash\)n"});

   l = \mbox{\hyperlink{group__Eina__List__Group_gad4a1e3b0fdecd8ed4cb2ff592ceeb553}{eina\_list\_nth\_list}}(list, 1);
   list = \mbox{\hyperlink{group__Eina__List__Group_gafa705d4483487e53d1be93a30e43c66d}{eina\_list\_append\_relative\_list}}(list, \textcolor{stringliteral}{"cain"}, l);

   list = \mbox{\hyperlink{group__Eina__List__Group_ga4676c189ca4bcfa22d7ecfbcd00200ae}{eina\_list\_append\_relative}}(list, \textcolor{stringliteral}{"zarek"}, \textcolor{stringliteral}{"cain"});

   list = \mbox{\hyperlink{group__Eina__List__Group_ga9f35bfc7c5b798014c3e0a74bc6f39ad}{eina\_list\_prepend}}(list, \textcolor{stringliteral}{"adama"});

   list = \mbox{\hyperlink{group__Eina__List__Group_gad44370d18554ff250d2e9ddac4653caf}{eina\_list\_prepend\_relative}}(list, \textcolor{stringliteral}{"gaeta"}, \textcolor{stringliteral}{"cain"});

   list = \mbox{\hyperlink{group__Eina__List__Group_ga03a77b1579ee83bcab4bc3d67375d4b1}{eina\_list\_prepend\_relative\_list}}(list, \textcolor{stringliteral}{"lampkin"}, l);

   \mbox{\hyperlink{group__Eina__List__Group_gac6efafc19f526d916cdb9757240a8773}{EINA\_LIST\_FOREACH}}(list, l, list\_data)
     printf(\textcolor{stringliteral}{"%s\(\backslash\)n"}, (\textcolor{keywordtype}{char}*)list\_data);

   \mbox{\hyperlink{group__Eina__List__Group_ga608bd2fbf06293a1b794648990703ab4}{eina\_list\_free}}(list);

   \mbox{\hyperlink{group__Eina__Main__Group_ga6741fcaba116e31e96ce14dcfa03f568}{eina\_shutdown}}();

   \textcolor{keywordflow}{return} 0;
\}
\end{DoxyCodeInclude}


More examples can be found at \mbox{\hyperlink{eina_examples}{Eina Examples}}. 