Eio asynchronous API for Eet file.

This set of functions help in the asynchronous use of Eet. More...

Functions

EAPI Eio_Fileeio_eet_open (const char *filename, Eet_File_Mode mode, Eio_Eet_Open_Cb eet_cb, Eio_Error_Cb error_cb, const void *data)
 Open an eet file on disk, and returns a handle to it asynchronously.
EAPI Eio_Fileeio_eet_close (Eet_File *ef, Eio_Done_Cb done_cb, Eio_Eet_Error_Cb error_cb, const void *data)
 Close an eet file handle and flush pending writes asynchronously.
EAPI Eio_Fileeio_eet_sync (Eet_File *ef, Eio_Done_Cb done_cb, Eio_Eet_Error_Cb error_cb, const void *data)
 Sync content of an eet file handle, flushing pending writes asynchronously.
EAPI Eio_Fileeio_eet_data_write_cipher (Eet_File *ef, Eet_Data_Descriptor *edd, const char *name, const char *cipher_key, void *write_data, int compress, Eio_Done_Int_Cb done_cb, Eio_Error_Cb error_cb, const void *user_data)
 Write a data structure from memory and store in an eet file using a cipher asynchronously.
EAPI Eio_Fileeio_eet_data_read_cipher (Eet_File *ef, Eet_Data_Descriptor *edd, const char *name, const char *cipher_key, Eio_Done_ERead_Cb done_cb, Eio_Error_Cb error_cb, const void *data)
 Read a data structure from an eet file and decodes it using a cipher asynchronously.
EAPI Eio_Fileeio_eet_data_image_write_cipher (Eet_File *ef, const char *name, const char *cipher_key, void *write_data, unsigned int w, unsigned int h, int alpha, int compress, int quality, int lossy, Eio_Done_Int_Cb done_cb, Eio_Error_Cb error_cb, const void *user_data)
 Write image data to the named key in an eet file asynchronously.
EAPI Eio_Fileeio_eet_read_direct (Eet_File *ef, const char *name, Eio_Done_Data_Cb done_cb, Eio_Error_Cb error_cb, const void *data)
 Read a specified entry from an eet file and return data.
EAPI Eio_Fileeio_eet_read_cipher (Eet_File *ef, const char *name, const char *cipher_key, Eio_Done_Read_Cb done_cb, Eio_Error_Cb error_cb, const void *data)
 Read a specified entry from an eet file and return data.
EAPI Eio_Fileeio_eet_write_cipher (Eet_File *ef, const char *name, void *write_data, int size, int compress, const char *cipher_key, Eio_Done_Int_Cb done_cb, Eio_Error_Cb error_cb, const void *user_data)
 Write a specified entry to an eet file handle using a cipher.

Detailed Description

This set of functions help in the asynchronous use of Eet.


Function Documentation

EAPI Eio_File* eio_eet_open ( const char *  filename,
Eet_File_Mode  mode,
Eio_Eet_Open_Cb  eet_cb,
Eio_Error_Cb  error_cb,
const void *  data 
)

Open an eet file on disk, and returns a handle to it asynchronously.

Parameters:
filename The file path to the eet file. eg: "/tmp/file.eet".
mode The mode for opening. Either EET_FILE_MODE_READ, EET_FILE_MODE_WRITE or EET_FILE_MODE_READ_WRITE.
eet_cb The callback to call when the file has been successfully opened.
error_cb Callback called in the main loop when the file can't be opened.
data Unmodified user data passed to callbacks
Returns:
NULL in case of a failure.

This function calls eet_open() from another thread using Ecore_Thread.

EAPI Eio_File* eio_eet_close ( Eet_File *  ef,
Eio_Done_Cb  done_cb,
Eio_Eet_Error_Cb  error_cb,
const void *  data 
)

Close an eet file handle and flush pending writes asynchronously.

Parameters:
ef A valid eet file handle.
done_cb Callback called from the main loop when the file has been closed.
error_cb Callback called in the main loop when the file can't be closed.
data Unmodified user data passed to callbacks
Returns:
NULL in case of a failure.

This function will call eet_close() from another thread by using Ecore_Thread. You should assume that the Eet_File is dead after this function is called.

EAPI Eio_File* eio_eet_sync ( Eet_File *  ef,
Eio_Done_Cb  done_cb,
Eio_Eet_Error_Cb  error_cb,
const void *  data 
)

Sync content of an eet file handle, flushing pending writes asynchronously.

Parameters:
ef A valid eet file handle.
done_cb Callback called from the main loop when the file has been synced.
error_cb Callback called in the main loop when the file can't be synced.
data Unmodified user data passed to callbacks
Returns:
NULL in case of a failure.

This function will call eet_sync() from another thread. As long as the done_cb or error_cb haven't be called, you must keep ef open.

EAPI Eio_File* eio_eet_data_write_cipher ( Eet_File *  ef,
Eet_Data_Descriptor *  edd,
const char *  name,
const char *  cipher_key,
void *  write_data,
int  compress,
Eio_Done_Int_Cb  done_cb,
Eio_Error_Cb  error_cb,
const void *  user_data 
)

Write a data structure from memory and store in an eet file using a cipher asynchronously.

Parameters:
ef The eet file handle to write to.
edd The data descriptor to use when encoding.
name The key to store the data under in the eet file.
cipher_key The key to use as cipher.
write_data A pointer to the data structure to save and encode.
compress Compression flags for storage.
done_cb Callback called from the main loop when the data has been put in the Eet_File.
error_cb Callback called in the main loop when the file can't be written.
user_data Private data given to each callback.
Returns:
NULL in case of a failure.
EAPI Eio_File* eio_eet_data_read_cipher ( Eet_File *  ef,
Eet_Data_Descriptor *  edd,
const char *  name,
const char *  cipher_key,
Eio_Done_ERead_Cb  done_cb,
Eio_Error_Cb  error_cb,
const void *  data 
)

Read a data structure from an eet file and decodes it using a cipher asynchronously.

Parameters:
ef The eet file handle to read from.
edd The data descriptor handle to use when decoding.
name The key the data is stored under in the eet file.
cipher_key The key to use as cipher.
done_cb Callback called from the main loop when the data has been read and decoded.
error_cb Callback called in the main loop when the data can't be read.
data Unmodified user data passed to callbacks
Returns:
NULL in case of a failure.
EAPI Eio_File* eio_eet_data_image_write_cipher ( Eet_File *  ef,
const char *  name,
const char *  cipher_key,
void *  write_data,
unsigned int  w,
unsigned int  h,
int  alpha,
int  compress,
int  quality,
int  lossy,
Eio_Done_Int_Cb  done_cb,
Eio_Error_Cb  error_cb,
const void *  user_data 
)

Write image data to the named key in an eet file asynchronously.

Parameters:
ef A valid eet file handle opened for writing.
name Name of the entry. eg: "/base/file_i_want".
cipher_key The key to use as cipher.
write_data A pointer to the image pixel data.
w The width of the image in pixels.
h The height of the image in pixels.
alpha The alpha channel flag.
compress The compression amount.
quality The quality encoding amount.
lossy The lossiness flag.
done_cb Callback called from the main loop when the data has been put in the Eet_File.
error_cb Callback called in the main loop when the file can't be written.
user_data Private data given to each callback.
Returns:
NULL in case of a failure.
EAPI Eio_File* eio_eet_read_direct ( Eet_File *  ef,
const char *  name,
Eio_Done_Data_Cb  done_cb,
Eio_Error_Cb  error_cb,
const void *  data 
)

Read a specified entry from an eet file and return data.

Parameters:
ef A valid eet file handle opened for reading.
name Name of the entry. eg: "/base/file_i_want".
done_cb Callback called from the main loop when the data has been read.
error_cb Callback called in the main loop when the data can't be read.
data Unmodified user data passed to callbacks
Returns:
NULL in case of a failure.
EAPI Eio_File* eio_eet_read_cipher ( Eet_File *  ef,
const char *  name,
const char *  cipher_key,
Eio_Done_Read_Cb  done_cb,
Eio_Error_Cb  error_cb,
const void *  data 
)

Read a specified entry from an eet file and return data.

Parameters:
ef A valid eet file handle opened for reading.
name Name of the entry. eg: "/base/file_i_want".
cipher_key The key to use as cipher.
done_cb Callback called from the main loop when the data has been read.
error_cb Callback called in the main loop when the data can't be read.
data Unmodified user data passed to callbacks
Returns:
NULL in case of a failure.
EAPI Eio_File* eio_eet_write_cipher ( Eet_File *  ef,
const char *  name,
void *  write_data,
int  size,
int  compress,
const char *  cipher_key,
Eio_Done_Int_Cb  done_cb,
Eio_Error_Cb  error_cb,
const void *  user_data 
)

Write a specified entry to an eet file handle using a cipher.

Parameters:
ef A valid eet file handle opened for writing.
name Name of the entry. eg: "/base/file_i_want".
write_data Pointer to the data to be stored.
size Length in bytes in the data to be stored.
compress Compression flags (1 == compress, 0 = don't compress).
cipher_key The key to use as cipher.
done_cb Callback called from the main loop when the data has been put in the Eet_File.
error_cb Callback called in the main loop when the file can't be written.
user_data Private data given to each callback.
Returns:
NULL in case of a failure.