Manipulate an Eina_File asynchronously

This function help manipulating file asynchronously. More...

Functions

EAPI Eio_Fileeio_file_open (const char *name, Eina_Bool shared, Eio_Open_Cb open_cb, Eio_Error_Cb error_cb, const void *data)
 Assynchronously open a file. More...
 
EAPI Eio_Fileeio_file_close (Eina_File *f, Eio_Done_Cb done_cb, Eio_Error_Cb error_cb, const void *data)
 Assynchronously close a file. More...
 
EAPI Eio_Fileeio_file_map_all (Eina_File *f, Eina_File_Populate rule, Eio_Filter_Map_Cb filter_cb, Eio_Map_Cb map_cb, Eio_Error_Cb error_cb, const void *data)
 Assynchronously map a file in memory. More...
 
EAPI Eio_Fileeio_file_map_new (Eina_File *f, Eina_File_Populate rule, unsigned long int offset, unsigned long int length, Eio_Filter_Map_Cb filter_cb, Eio_Map_Cb map_cb, Eio_Error_Cb error_cb, const void *data)
 Assynchronously map a part of a file in memory. More...
 

Detailed Description

This function help manipulating file asynchronously.

This set of function work on top of Eina_File and Ecore_Thread to do basic operations in a file, like openning, closing and mapping a file to memory.

Function Documentation

EAPI Eio_File* eio_file_open ( const char *  name,
Eina_Bool  shared,
Eio_Open_Cb  open_cb,
Eio_Error_Cb  error_cb,
const void *  data 
)

Assynchronously open a file.

Parameters
nameThe file to open.
sharedIf it's a shared memory file.
open_cbCallback called in the main loop when the file has been successfully opened.
error_cbCallback called in the main loop when the file couldn't be opened.
dataUnmodified user data passed to callbacks
Returns
Pointer to the file if successfull or NULL otherwise.

References eina_stringshare_add().

EAPI Eio_File* eio_file_close ( Eina_File f,
Eio_Done_Cb  done_cb,
Eio_Error_Cb  error_cb,
const void *  data 
)

Assynchronously close a file.

Parameters
fThe file to close.
done_cbCallback called in the main loop when the file has been successfully closed.
error_cbCallback called in the main loop when the file couldn't be closed.
dataUnmodified user data passed to callbacks
Returns
Pointer to the file if successfull or NULL otherwise.
EAPI Eio_File* eio_file_map_all ( Eina_File f,
Eina_File_Populate  rule,
Eio_Filter_Map_Cb  filter_cb,
Eio_Map_Cb  map_cb,
Eio_Error_Cb  error_cb,
const void *  data 
)

Assynchronously map a file in memory.

Parameters
fThe file to map.
ruleThe rule to apply to the map.
filter_cbCallback called in the thread to validate the content of the map.
map_cbCallback called in the main loop when the file has been successfully mapped.
error_cbCallback called in the main loop when the file can't be mapped.
dataUnmodified user data passed to callbacks
Returns
Pointer to the file if successfull or NULL otherwise.

The container of the Eio_File is the Eina_File.

References eina_file_size_get().

EAPI Eio_File* eio_file_map_new ( Eina_File f,
Eina_File_Populate  rule,
unsigned long int  offset,
unsigned long int  length,
Eio_Filter_Map_Cb  filter_cb,
Eio_Map_Cb  map_cb,
Eio_Error_Cb  error_cb,
const void *  data 
)

Assynchronously map a part of a file in memory.

Parameters
fThe file to map.
ruleThe rule to apply to the map.
offsetThe offset inside the file
lengthThe length of the memory to map
filter_cbCallback called in the thread to validate the content of the map.
map_cbCallback called in the main loop when the file has been successfully mapped.
error_cbCallback called in the main loop when the file can't be mapped.
dataUnmodified user data passed to callbacks
Returns
Pointer to the file if successfull or NULL otherwise.

The container of the Eio_File is the Eina_File.