Eina
Date
2008 (created)

Table of Contents

Introduction

The Eina library is a library that implements an API 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, BSD, Opensolaris and Windows (XP and CE).

The data types that are available are (see Data Types):

The tools that are available are (see Tools):

How to compile

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 pkg-config script outputs. For example:

Compiling C or C++ files into object files:

gcc -c -o main.o main.c `pkg-config --cflags eina`

Linking object files into a binary executable:

gcc -o my_application main.o `pkg-config --libs eina`

See pkgconfig

Next Steps

After you understood what Eina is and installed it in your system you should proceed understanding the programming interface.

Recommended reading:

Introductory Example

//Compile with:
//gcc -g eina_list_01.c -o eina_list_01 `pkg-config --cflags --libs eina`
#include <stdio.h>
#include <Eina.h>
int
main(int argc, char **argv)
{
(void)argc;
(void)argv;
Eina_List *list = NULL;
void *list_data;
list = eina_list_append(list, "tigh");
list = eina_list_append(list, "adar");
list = eina_list_append(list, "baltar");
list = eina_list_append(list, "roslin");
EINA_LIST_FOREACH(list, l, list_data)
printf("%s\n", (char*)list_data);
printf("\n");
l = eina_list_nth_list(list, 1);
list = eina_list_append_relative_list(list, "cain", l);
list = eina_list_append_relative(list, "zarek", "cain");
list = eina_list_prepend(list, "adama");
list = eina_list_prepend_relative(list, "gaeta", "cain");
list = eina_list_prepend_relative_list(list, "lampkin", l);
EINA_LIST_FOREACH(list, l, list_data)
printf("%s\n", (char*)list_data);
return 0;
}

More examples can be found at Eina Examples.