static void _eio_file_heavy(void *data, Ecore_Thread *thread) { Eio_File_Char_Ls *async = data; Eina_Iterator *ls; const char *file; Eina_List *pack = NULL; double start; ls = eina_file_ls(async->ls.directory); if (!ls) { eio_file_thread_error(&async->ls.common, thread); return; } eio_file_container_set(&async->ls.common, eina_iterator_container_get(ls)); start = ecore_time_get(); EINA_ITERATOR_FOREACH(ls, file) { Eina_Bool filter = EINA_TRUE; if (async->filter_cb) { filter = async->filter_cb((void*) async->ls.common.data, &async->ls.common, file); } if (filter) { Eio_File_Char *send_fc; send_fc = eio_char_malloc(); if (!send_fc) goto on_error; send_fc->filename = file; send_fc->associated = async->ls.common.worker.associated; async->ls.common.worker.associated = NULL; pack = eina_list_append(pack, send_fc); } else { on_error: eina_stringshare_del(file); if (async->ls.common.worker.associated) { eina_hash_free(async->ls.common.worker.associated); async->ls.common.worker.associated = NULL; } } pack = eio_pack_send(thread, pack, &start); if (ecore_thread_check(thread)) break; }
static void _eio_eet_open_job(void *data, Ecore_Thread *thread) { Eio_Eet_Open *eet = data; eet->result = eet_open(eet->filename, eet->mode); if (!eet->result) eio_file_thread_error(&eet->common, thread); }
static void _eio_file_open_job(void *data, Ecore_Thread *thread) { Eio_File_Map *map = data; map->result = eina_file_open(map->name, map->shared); if (!map->result) eio_file_thread_error(&map->common, thread); }
static void _eio_file_mkdir(void *data, Ecore_Thread *thread) { Eio_File_Mkdir *m = data; if (mkdir(m->path, m->mode) != 0) eio_file_thread_error(&m->common, thread); }