eio: make eio_file_map_* api more usefull.

SVN revision: 66573
This commit is contained in:
Cedric BAIL 2011-12-27 16:45:07 +00:00
parent 9bba5f92b0
commit 70b7b55c42
2 changed files with 8 additions and 5 deletions

View File

@ -124,8 +124,8 @@ typedef void (*Eio_Stat_Cb)(void *data, Eio_File *handler, const struct stat *st
typedef void (*Eio_Progress_Cb)(void *data, Eio_File *handler, const Eio_Progress *info);
typedef void (*Eio_Open_Cb)(void *data, Eio_File *handler, Eina_File *file);
typedef Eina_Bool (*Eio_Filter_Map_Cb)(void *data, Eio_File *handler, void *map);
typedef void (*Eio_Map_Cb)(void *data, Eio_File *handler, void *map);
typedef Eina_Bool (*Eio_Filter_Map_Cb)(void *data, Eio_File *handler, void *map, size_t length);
typedef void (*Eio_Map_Cb)(void *data, Eio_File *handler, void *map, size_t length);
typedef void (*Eio_Done_Data_Cb)(void *data, Eio_File *handler, const char *xattr_data, unsigned int xattr_size);
typedef void (*Eio_Done_String_Cb)(void *data, Eio_File *handler, const char *xattr_string);

View File

@ -101,7 +101,8 @@ _eio_file_map_all_job(void *data, Ecore_Thread *thread)
{
if (!map->filter_cb((void*) map->common.data,
&map->common,
map->result))
map->result,
map->length))
{
eina_file_map_free(map->common.container, map->result);
map->result = NULL;
@ -123,7 +124,8 @@ _eio_file_map_new_job(void *data, Ecore_Thread *thread)
{
if (!map->filter_cb((void*) map->common.data,
&map->common,
map->result))
map->result,
map->length))
{
eina_file_map_free(map->common.container, map->result);
map->result = NULL;
@ -139,7 +141,7 @@ _eio_file_map_end(void *data, Ecore_Thread *thread __UNUSED__)
{
Eio_File_Map_Rule *map = data;
map->map_cb((void*) map->common.data, &map->common, map->result);
map->map_cb((void*) map->common.data, &map->common, map->result, map->length);
free(map);
}
@ -258,6 +260,7 @@ eio_file_map_all(Eina_File *f,
map->map_cb = map_cb;
map->rule = rule;
map->result = NULL;
map->length = eina_file_size_get(f);
if (!eio_file_set(&map->common,
NULL,