Eet Library Documentation

1.6.1

Eet Data Handling Library Public API Calls These routines are used for Eet Library interaction

Version:
1.5.0
Date:
2000-2012
Please see the Authors page for contact details.

Table of Contents

What is Eet?

It is a tiny library designed to write an arbitrary set of chunks of data to a file and optionally compress each chunk (very much like a zip file) and allow fast random-access reading of the file later on. It does not do zip as a zip itself has more complexity than is needed, and it was much simpler to implement this once here.

Eet is extremely fast, small and simple. Eet files can be very small and highly compressed, making them very optimal for just sending across the internet without having to archive, compress or decompress and install them. They allow for lightning-fast random-access reads once created, making them perfect for storing data that is written once (or rarely) and read many times, but the program does not want to have to read it all in at once.

It also can encode and decode data structures in memory, as well as image data for saving to Eet files or sending across the network to other machines, or just writing to arbitrary files on the system. All data is encoded in a platform independent way and can be written and read by any architecture.

A simple example on using Eet

Here is a simple example on how to use Eet to save a series of strings to a file and load them again. The advantage of using Eet over just fprintf() and fscanf() is that not only can these entries be strings, they need no special parsing to handle delimiter characters or escaping, they can be binary data, image data, data structures containing integers, strings, other data structures, linked lists and much more, without the programmer having to worry about parsing, and best of all, Eet is very fast.

This is just a very simple example that doesn't show all of the capabilities of Eet, but it serves to illustrate its simplicity.

How to compile using Eet ?

Eet 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 eet`
   

Linking object files into a binary executable:

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

You simply have to make sure that pkg-config is in your shell's PATH (see the manual page for your appropriate shell) and eet.pc in /usr/lib/pkgconfig or its path is in the PKG_CONFIG_PATH environment variable. It's that simple to link and use Eet once you have written your code to use it.

Since the program is linked to Eet, it is now able to use any advertised API calls to serialize your data.

You should make sure you add any extra compile and link flags to your compile commands that your application may need as well. The above example is only guaranteed to make Eet add it's own requirements.

How is it installed?

Simple:

   ./configure
   make
   su -
   ...
   make install
   

Next Steps

After you understood what Eet is and installed it in your system you should proceed understanding the programming interface. We'd recommend you to take a while to learn Eina (http://docs.enlightenment.org/auto/eina/) as it is very convenient and optimized, and Eet provides integration with it.

Recommended reading:

  • Eet File Main Functions to know the basics to open and save files.
  • Eet Data Serialization to know the convenient way to serialize and parse your data structures automatically. Just create your descriptors and let Eet do the work for you.

Introductory Examples

Examples

Todo:
Document data format for images and data structures.