This are helper provided around core Eio API. More...
Functions | |
static double | eio_file_atime (const Eina_Stat *st) |
Return last access time to a file. More... | |
static double | eio_file_mtime (const Eina_Stat *st) |
Return last modification time of a file. More... | |
static long long | eio_file_size (const Eina_Stat *st) |
Return file length. More... | |
static Eina_Bool | eio_file_is_dir (const Eina_Stat *st) |
Return if path is a directory. More... | |
static Eina_Bool | eio_file_is_lnk (const Eina_Stat *st) |
Return if path is a length. More... | |
EIO_API int | eio_init (void) |
Initialize eio and all its required submodule. More... | |
EIO_API int | eio_shutdown (void) |
Shutdown eio and all its submodule if possible. More... | |
EIO_API void | eio_memory_burst_limit_set (size_t limit) |
Set the limit to the maximum amount of memory used. More... | |
EIO_API size_t | eio_memory_burst_limit_get (void) |
Get the actual limit to the maximum amount of memory used. More... | |
EIO_API void * | eio_file_container_get (Eio_File *ls) |
Return the container during EIO operation. More... | |
EIO_API Eina_Bool | eio_file_cancel (Eio_File *ls) |
Cancel any Eio_File. More... | |
EIO_API Eina_Bool | eio_file_check (Eio_File *ls) |
Check if an Eio_File operation has been cancelled. More... | |
EIO_API Eina_Bool | eio_file_associate_add (Eio_File *ls, const char *key, const void *data, Eina_Free_Cb free_cb) |
Associate data with the current filtered file. More... | |
EIO_API Eina_Bool | eio_file_associate_direct_add (Eio_File *ls, const char *key, const void *data, Eina_Free_Cb free_cb) |
Associate data with the current filtered file. More... | |
EIO_API void * | eio_file_associate_find (Eio_File *ls, const char *key) |
Get the data associated during the filter callback inside the main loop. More... | |
This are helper provided around core Eio API.
This set of functions do provide helper to work around data provided by Eio without the need to look at system header.
|
inlinestatic |
Return last access time to a file.
st | The stat buffer as given by eio_file_stat callback. |
This function return the st_atime field, last access time, as double like all EFL time call.
References _Eina_Stat::atime.
|
inlinestatic |
Return last modification time of a file.
st | The stat buffer as given by eio_file_stat callback. |
This function return the st_mtime field, last modification time, as double like all EFL time call.
References _Eina_Stat::mtime.
|
inlinestatic |
Return file length.
st | The stat buffer as given by eio_file_stat callback. |
This function is just an accessor to st_size and return the file length.
References _Eina_Stat::size.
Return if path is a directory.
st | The stat buffer as given by eio_file_stat callback. |
This function tell you if the stated path is a directory or not.
References EINA_FALSE, EINA_TRUE, and _Eina_Stat::mode.
Return if path is a length.
st | The stat buffer as given by eio_file_stat callback. |
This function tell you if the stated path is a length or not.
References EINA_FALSE, EINA_TRUE, and _Eina_Stat::mode.
EIO_API int eio_init | ( | void | ) |
Initialize eio and all its required submodule.
References ecore_init(), efreet_mime_init(), eina_condition_new(), eina_init(), eina_lock_new(), eina_log_domain_register(), EINA_LOG_ERR, eina_spinlock_new(), and ERR.
Referenced by elm_quicklaunch_init().
EIO_API int eio_shutdown | ( | void | ) |
Shutdown eio and all its submodule if possible.
References EINA_LOG_STATE_SHUTDOWN, EINA_LOG_STATE_START, eina_log_timing(), and ERR.
EIO_API void eio_memory_burst_limit_set | ( | size_t | limit | ) |
Set the limit to the maximum amount of memory used.
limit | The actual limit to set. |
Eio work by burst, allocating memory in a thread and moving it back to the main loop. This result in quite some huge memory usage if the main loop is to slow to cope with the speed of the thread. By setting this limit, the thread will block until enough memory has been freed to be below the limit again.
By default no limit is set and any value < 0 will mean no limit.
References eina_condition_broadcast(), eina_lock_release(), and eina_lock_take().
EIO_API size_t eio_memory_burst_limit_get | ( | void | ) |
Get the actual limit to the maximum amount of memory used.
EIO_API void * eio_file_container_get | ( | Eio_File * | ls | ) |
Return the container during EIO operation.
ls | The asynchronous I/O operation to retrieve container from. |
This is only available and make sense in the thread callback, not in the mainloop.
References EINA_SAFETY_ON_NULL_RETURN_VAL.
Cancel any Eio_File.
ls | The asynchronous I/O operation to cancel. |
This will cancel any kind of I/O operation and cleanup the mess. This means that it could take time to cancel an I/O.
References ecore_thread_cancel(), EINA_FALSE, and EINA_SAFETY_ON_NULL_RETURN_VAL.
Check if an Eio_File operation has been cancelled.
ls | The asynchronous I/O operation to check. |
In case of an error it also return EINA_TRUE.
References ecore_thread_check(), EINA_SAFETY_ON_NULL_RETURN_VAL, and EINA_TRUE.
EIO_API Eina_Bool eio_file_associate_add | ( | Eio_File * | ls, |
const char * | key, | ||
const void * | data, | ||
Eina_Free_Cb | free_cb | ||
) |
Associate data with the current filtered file.
ls | The Eio_File ls request currently calling the filter callback. |
key | The key to associate data to. |
data | The data to associate the data to. |
free_cb | Optionally a function to call to free the associated data, data is passed as the callback data parameter. If no free_cb is provided the user data remains untouched. |
This function can only be safely called from within the filter callback. If you don't need to copy the key around you can use eio_file_associate_direct_add
References EINA_FALSE, eina_hash_add(), eina_hash_string_small_new(), and EINA_SAFETY_ON_NULL_RETURN_VAL.
EIO_API Eina_Bool eio_file_associate_direct_add | ( | Eio_File * | ls, |
const char * | key, | ||
const void * | data, | ||
Eina_Free_Cb | free_cb | ||
) |
Associate data with the current filtered file.
ls | The Eio_File ls request currently calling the filter callback. |
key | The key to associate data to (will not be copied, and the pointer will not be used as long as the file is not notified). |
data | The data to associate the data to. |
free_cb | The function to call to free the associated data, free_cb will be called if not specified. |
This function can only be safely called from within the filter callback. If you need eio to make a proper copy of the key
to be safe use eio_file_associate_add instead.
References EINA_FALSE, eina_hash_direct_add(), eina_hash_string_small_new(), and EINA_SAFETY_ON_NULL_RETURN_VAL.
EIO_API void * eio_file_associate_find | ( | Eio_File * | ls, |
const char * | key | ||
) |
Get the data associated during the filter callback inside the main loop.
ls | The Eio_File ls request currently calling the notify callback. |
key | The key pointing to the data to retrieve. |
NULL
if not found. References eina_hash_find(), and EINA_SAFETY_ON_NULL_RETURN_VAL.