Functions
Eio asynchronous API for Eet file.

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

Functions

EIO_API 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. More...
 
EIO_API 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. More...
 
EIO_API 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. More...
 
EIO_API 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. More...
 
EIO_API 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. More...
 
EIO_API 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. More...
 
EIO_API 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. More...
 
EIO_API 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. More...
 
EIO_API 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. More...
 

Detailed Description

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

Function Documentation

◆ eio_eet_open()

EIO_API 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
filenameThe file path to the eet file. eg: "/tmp/file.eet".
modeThe mode for opening. Either EET_FILE_MODE_READ, EET_FILE_MODE_WRITE or EET_FILE_MODE_READ_WRITE.
eet_cbThe callback to call when the file has been successfully opened.
error_cbCallback called in the main loop when the file can't be opened.
dataUnmodified user data passed to callbacks
Returns
NULL in case of a failure.

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

◆ eio_eet_close()

EIO_API 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
efA valid eet file handle.
done_cbCallback called from the main loop when the file has been closed.
error_cbCallback called in the main loop when the file can't be closed.
dataUnmodified 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.

◆ eio_eet_sync()

EIO_API 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
efA valid eet file handle.
done_cbCallback called from the main loop when the file has been synced.
error_cbCallback called in the main loop when the file can't be synced.
dataUnmodified 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.

◆ eio_eet_data_write_cipher()

EIO_API 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
efThe eet file handle to write to.
eddThe data descriptor to use when encoding.
nameThe key to store the data under in the eet file.
cipher_keyThe key to use as cipher.
write_dataA pointer to the data structure to save and encode.
compressCompression flags for storage.
done_cbCallback called from the main loop when the data has been put in the Eet_File.
error_cbCallback called in the main loop when the file can't be written.
user_dataPrivate data given to each callback.
Returns
NULL in case of a failure.

◆ eio_eet_data_read_cipher()

EIO_API 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
efThe eet file handle to read from.
eddThe data descriptor handle to use when decoding.
nameThe key the data is stored under in the eet file.
cipher_keyThe key to use as cipher.
done_cbCallback called from the main loop when the data has been read and decoded.
error_cbCallback called in the main loop when the data can't be read.
dataUnmodified user data passed to callbacks
Returns
NULL in case of a failure.

◆ eio_eet_data_image_write_cipher()

EIO_API 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
efA valid eet file handle opened for writing.
nameName of the entry. eg: "/base/file_i_want".
cipher_keyThe key to use as cipher.
write_dataA pointer to the image pixel data.
wThe width of the image in pixels.
hThe height of the image in pixels.
alphaThe alpha channel flag.
compressThe compression amount.
qualityThe quality encoding amount.
lossyThe lossiness flag.
done_cbCallback called from the main loop when the data has been put in the Eet_File.
error_cbCallback called in the main loop when the file can't be written.
user_dataPrivate data given to each callback.
Returns
NULL in case of a failure.

◆ eio_eet_read_direct()

EIO_API 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
efA valid eet file handle opened for reading.
nameName of the entry. eg: "/base/file_i_want".
done_cbCallback called from the main loop when the data has been read.
error_cbCallback called in the main loop when the data can't be read.
dataUnmodified user data passed to callbacks
Returns
NULL in case of a failure.

◆ eio_eet_read_cipher()

EIO_API 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
efA valid eet file handle opened for reading.
nameName of the entry. eg: "/base/file_i_want".
cipher_keyThe key to use as cipher.
done_cbCallback called from the main loop when the data has been read.
error_cbCallback called in the main loop when the data can't be read.
dataUnmodified user data passed to callbacks
Returns
NULL in case of a failure.

◆ eio_eet_write_cipher()

EIO_API 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
efA valid eet file handle opened for writing.
nameName of the entry. eg: "/base/file_i_want".
write_dataPointer to the data to be stored.
sizeLength in bytes in the data to be stored.
compressCompression flags (1 == compress, 0 = don't compress).
cipher_keyThe key to use as cipher.
done_cbCallback called from the main loop when the data has been put in the Eet_File.
error_cbCallback called in the main loop when the file can't be written.
user_dataPrivate data given to each callback.
Returns
NULL in case of a failure.