2013-05-16 06:34:03 -07:00
|
|
|
/* EIO - Core asynchronous input/output operation library.
|
2010-07-22 09:08:17 -07:00
|
|
|
* Copyright (C) 2010 Enlightenment Developers:
|
|
|
|
* Cedric Bail <cedric.bail@free.fr>
|
2013-05-16 06:34:03 -07:00
|
|
|
* Gustavo Sverzut Barbieri <barbieri@gmail.com>
|
2010-07-22 09:08:17 -07:00
|
|
|
* Vincent "caro" Torri <vtorri at univ-evry dot fr>
|
2016-08-05 18:33:27 -07:00
|
|
|
* Stephen "okra" Houston <smhouston88@gmail.com>
|
2013-05-16 17:33:22 -07:00
|
|
|
* Guillaume "kuri" Friloux <guillaume.friloux@asp64.com>
|
2010-07-22 09:08:17 -07:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library;
|
|
|
|
* if not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef EIO_H__
|
|
|
|
# define EIO_H__
|
|
|
|
|
2010-08-31 09:24:58 -07:00
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/stat.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
|
2010-07-22 09:08:17 -07:00
|
|
|
#include <Eina.h>
|
2012-02-21 13:01:22 -08:00
|
|
|
#include <Eet.h>
|
2013-11-04 01:31:48 -08:00
|
|
|
#include <Efl_Config.h>
|
2010-07-22 09:08:17 -07:00
|
|
|
|
|
|
|
#ifdef EAPI
|
|
|
|
# undef EAPI
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef _WIN32
|
2018-01-18 01:04:03 -08:00
|
|
|
# ifdef EFL_BUILD
|
2010-07-22 09:08:17 -07:00
|
|
|
# ifdef DLL_EXPORT
|
|
|
|
# define EAPI __declspec(dllexport)
|
|
|
|
# else
|
|
|
|
# define EAPI
|
2018-01-18 01:04:03 -08:00
|
|
|
# endif
|
2010-07-22 09:08:17 -07:00
|
|
|
# else
|
|
|
|
# define EAPI __declspec(dllimport)
|
2018-01-18 01:04:03 -08:00
|
|
|
# endif
|
2010-07-22 09:08:17 -07:00
|
|
|
#else
|
|
|
|
# ifdef __GNUC__
|
|
|
|
# if __GNUC__ >= 4
|
|
|
|
# define EAPI __attribute__ ((visibility("default")))
|
|
|
|
# else
|
|
|
|
# define EAPI
|
|
|
|
# endif
|
|
|
|
# else
|
|
|
|
# define EAPI
|
|
|
|
# endif
|
2018-01-18 01:04:03 -08:00
|
|
|
#endif
|
2010-07-22 09:08:17 -07:00
|
|
|
|
2010-10-12 07:59:30 -07:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2018-02-26 11:46:35 -08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @typedef Eio_File
|
|
|
|
* Generic asynchronous I/O reference.
|
|
|
|
* @ingroup Eio
|
|
|
|
*/
|
|
|
|
typedef struct _Eio_File Eio_File;
|
|
|
|
|
|
|
|
typedef Eina_Bool (*Eio_Filter_Direct_Cb)(void *data, Eio_File *handler, const Eina_File_Direct_Info *info);
|
|
|
|
|
2016-04-12 12:00:23 -07:00
|
|
|
#ifndef EFL_NOLEGACY_API_SUPPORT
|
|
|
|
#include "Eio_Legacy.h"
|
|
|
|
#endif
|
|
|
|
#ifdef EFL_EO_API_SUPPORT
|
|
|
|
#include "Eio_Eo.h"
|
|
|
|
#endif
|
2011-06-22 10:45:22 -07:00
|
|
|
|
2011-12-03 05:21:07 -08:00
|
|
|
/**
|
2012-02-23 03:46:51 -08:00
|
|
|
* @brief get access time from a Eina_Stat
|
2012-02-22 08:30:43 -08:00
|
|
|
* @param stat the structure to get the atime from
|
|
|
|
* @return the last accessed time
|
|
|
|
*
|
|
|
|
* This take care of doing type conversion to match rest of EFL time API.
|
|
|
|
* @note some filesystem don't update that information.
|
2011-12-03 05:21:07 -08:00
|
|
|
*/
|
2012-02-23 03:46:51 -08:00
|
|
|
static inline double eio_file_atime(const Eina_Stat *stat);
|
2011-12-03 05:21:07 -08:00
|
|
|
|
2010-10-28 07:50:24 -07:00
|
|
|
/**
|
2012-02-23 03:46:51 -08:00
|
|
|
* @brief get modification time from a Eina_Stat
|
2012-02-22 08:30:43 -08:00
|
|
|
* @param stat the structure to get the mtime from
|
|
|
|
* @return the last modification time
|
|
|
|
*
|
|
|
|
* This take care of doing type conversion to match rest of EFL time API.
|
2010-10-28 07:50:24 -07:00
|
|
|
*/
|
2012-02-23 03:46:51 -08:00
|
|
|
static inline double eio_file_mtime(const Eina_Stat *stat);
|
2010-10-28 07:50:24 -07:00
|
|
|
|
|
|
|
/**
|
2012-02-23 03:46:51 -08:00
|
|
|
* @brief get the size of the file described in Eina_Stat
|
2012-02-22 08:30:43 -08:00
|
|
|
* @param stat the structure to get the size from
|
|
|
|
* @return the size of the file
|
2010-10-28 07:50:24 -07:00
|
|
|
*/
|
2012-02-23 03:46:51 -08:00
|
|
|
static inline long long eio_file_size(const Eina_Stat *stat);
|
2012-02-22 08:30:43 -08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief tell if the stated path was a directory or not.
|
|
|
|
* @param stat the structure to get the size from
|
|
|
|
* @return EINA_TRUE, if it was.
|
|
|
|
*/
|
2012-02-23 03:46:51 -08:00
|
|
|
static inline Eina_Bool eio_file_is_dir(const Eina_Stat *stat);
|
2012-02-22 08:30:43 -08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief tell if the stated path was a link or not.
|
|
|
|
* @param stat the structure to get the size from
|
|
|
|
* @return EINA_TRUE, if it was.
|
|
|
|
*/
|
2012-02-23 03:46:51 -08:00
|
|
|
static inline Eina_Bool eio_file_is_lnk(const Eina_Stat *stat);
|
2010-10-28 07:50:24 -07:00
|
|
|
|
eio: add method for setting the global file polling rate for fallback monitors
Summary:
the default value for the fallback poll monitor timer interval is 60.0 seconds,
which is not useful for all cases, such as CI, where we don't care about cpu
usage and just want things to process as fast as possible at all times
this enables setting the interval to any value, ensuring that any existing
timers are modified to use that value immediately
@feature
Reviewers: stefan_schmidt, bu5hm4n, raster, devilhorns, ManMower
Reviewed By: bu5hm4n, ManMower
Subscribers: ManMower, raster, bu5hm4n, cedric, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D6247
2018-06-19 10:33:14 -07:00
|
|
|
/**
|
|
|
|
* @ingroup Eio
|
|
|
|
*
|
|
|
|
* @brief Set the polling interval to control the fallback monitor behavior
|
|
|
|
* @param interval The interval (in seconds) to poll
|
|
|
|
* @since 1.21
|
|
|
|
*/
|
|
|
|
EAPI void eio_monitoring_interval_set(double interval);
|
|
|
|
|
2010-10-29 05:58:04 -07:00
|
|
|
#include "eio_inline_helper.x"
|
|
|
|
|
2016-04-12 12:00:23 -07:00
|
|
|
#define EIO_VERSION_MAJOR EFL_VERSION_MAJOR
|
|
|
|
#define EIO_VERSION_MINOR EFL_VERSION_MINOR
|
|
|
|
|
2010-10-12 07:59:30 -07:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2015-04-28 06:12:42 -07:00
|
|
|
#undef EAPI
|
|
|
|
#define EAPI
|
2010-10-12 07:59:30 -07:00
|
|
|
|
2010-07-22 09:08:17 -07:00
|
|
|
#endif
|